private void releaseResources() { if (player != null) { try { player.stop(); player.close(); } catch (Exception e) { } } }
private void closePlayer() { if (null != player) { try { player.stop(); } catch (Exception e) { } try { player.close(); } catch (Exception e) { } player = null; } }
public void stop() { if (mPlayer == null) return; // nothing to stop mRunning = false; try { if (mPlayer.getState() == Player.STARTED) { mPlayer.stop(); } if (mPlayer.getState() != Player.CLOSED) { mPlayer.close(); } } catch (MediaException e) { sLogger.error("Error stopping reveive stream", e); } }
public static final void Tiger_Sound_Final() { // #if (TIGER=="TRUE") if (SoundPlayer != null) { if (SoundPlayer.getState() == Player.STARTED) { try { SoundPlayer.stop(); } catch (Exception e) { } } SoundPlayer.deallocate(); SoundPlayer.close(); SoundPlayer = null; } ; // #endif }
public void stopAll() throws Exception { LogUtil.put(LogFactory.getInstance(CommonStrings.getInstance().START, this, "stopAll")); Sound[] soundInterfaceArray = soundsFactoryInterface.getSoundInterfaceArray(); ProgressCanvas progressCanvas = ProgressCanvasFactory.getInstance(); for (int index = 0; index < soundInterfaceArray.length; index++) { if (soundInterfaceArray[index] != null) { Player player = soundInterfaceArray[index].getPlayer(); if (player != null) { player.stop(); progressCanvas.addPortion(100, "Stopping Sound: ", index); } } } }