Loading media/java/android/media/AudioTrack.java +12 −12 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class AudioTrack audioBuffSizeCheck(bufferSizeInBytes); if (sessionId < 0) { throw (new IllegalArgumentException("Invalid audio session ID: "+sessionId)); throw new IllegalArgumentException("Invalid audio session ID: "+sessionId); } int[] session = new int[1]; Loading Loading @@ -375,7 +375,7 @@ public class AudioTrack && (streamType != AudioManager.STREAM_NOTIFICATION) && (streamType != AudioManager.STREAM_BLUETOOTH_SCO) && (streamType != AudioManager.STREAM_DTMF)) { throw (new IllegalArgumentException("Invalid stream type.")); throw new IllegalArgumentException("Invalid stream type."); } else { mStreamType = streamType; } Loading @@ -383,8 +383,8 @@ public class AudioTrack //-------------- // sample rate, note these values are subject to change if ( (sampleRateInHz < 4000) || (sampleRateInHz > 48000) ) { throw (new IllegalArgumentException(sampleRateInHz + "Hz is not a supported sample rate.")); throw new IllegalArgumentException(sampleRateInHz + "Hz is not a supported sample rate."); } else { mSampleRate = sampleRateInHz; } Loading @@ -411,7 +411,7 @@ public class AudioTrack mChannelCount = 0; mChannels = AudioFormat.CHANNEL_INVALID; mChannelConfiguration = AudioFormat.CHANNEL_INVALID; throw(new IllegalArgumentException("Unsupported channel configuration.")); throw new IllegalArgumentException("Unsupported channel configuration."); } else { mChannels = channelConfig; mChannelCount = Integer.bitCount(channelConfig); Loading @@ -430,14 +430,14 @@ public class AudioTrack break; default: mAudioFormat = AudioFormat.ENCODING_INVALID; throw(new IllegalArgumentException("Unsupported sample encoding." + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT.")); throw new IllegalArgumentException("Unsupported sample encoding." + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT."); } //-------------- // audio load mode if ( (mode != MODE_STREAM) && (mode != MODE_STATIC) ) { throw(new IllegalArgumentException("Invalid mode.")); throw new IllegalArgumentException("Invalid mode."); } else { mDataLoadMode = mode; } Loading Loading @@ -487,7 +487,7 @@ public class AudioTrack int frameSizeInBytes = mChannelCount * (mAudioFormat == AudioFormat.ENCODING_PCM_8BIT ? 1 : 2); if ((audioBufferSize % frameSizeInBytes != 0) || (audioBufferSize < 1)) { throw (new IllegalArgumentException("Invalid audio buffer size.")); throw new IllegalArgumentException("Invalid audio buffer size."); } mNativeBufferSizeInBytes = audioBufferSize; Loading Loading @@ -894,7 +894,7 @@ public class AudioTrack public void play() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("play() called on uninitialized AudioTrack.")); throw new IllegalStateException("play() called on uninitialized AudioTrack."); } synchronized(mPlayStateLock) { Loading @@ -914,7 +914,7 @@ public class AudioTrack public void stop() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("stop() called on uninitialized AudioTrack.")); throw new IllegalStateException("stop() called on uninitialized AudioTrack."); } // stop playing Loading @@ -934,7 +934,7 @@ public class AudioTrack public void pause() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("pause() called on uninitialized AudioTrack.")); throw new IllegalStateException("pause() called on uninitialized AudioTrack."); } //logd("pause()"); Loading Loading
media/java/android/media/AudioTrack.java +12 −12 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class AudioTrack audioBuffSizeCheck(bufferSizeInBytes); if (sessionId < 0) { throw (new IllegalArgumentException("Invalid audio session ID: "+sessionId)); throw new IllegalArgumentException("Invalid audio session ID: "+sessionId); } int[] session = new int[1]; Loading Loading @@ -375,7 +375,7 @@ public class AudioTrack && (streamType != AudioManager.STREAM_NOTIFICATION) && (streamType != AudioManager.STREAM_BLUETOOTH_SCO) && (streamType != AudioManager.STREAM_DTMF)) { throw (new IllegalArgumentException("Invalid stream type.")); throw new IllegalArgumentException("Invalid stream type."); } else { mStreamType = streamType; } Loading @@ -383,8 +383,8 @@ public class AudioTrack //-------------- // sample rate, note these values are subject to change if ( (sampleRateInHz < 4000) || (sampleRateInHz > 48000) ) { throw (new IllegalArgumentException(sampleRateInHz + "Hz is not a supported sample rate.")); throw new IllegalArgumentException(sampleRateInHz + "Hz is not a supported sample rate."); } else { mSampleRate = sampleRateInHz; } Loading @@ -411,7 +411,7 @@ public class AudioTrack mChannelCount = 0; mChannels = AudioFormat.CHANNEL_INVALID; mChannelConfiguration = AudioFormat.CHANNEL_INVALID; throw(new IllegalArgumentException("Unsupported channel configuration.")); throw new IllegalArgumentException("Unsupported channel configuration."); } else { mChannels = channelConfig; mChannelCount = Integer.bitCount(channelConfig); Loading @@ -430,14 +430,14 @@ public class AudioTrack break; default: mAudioFormat = AudioFormat.ENCODING_INVALID; throw(new IllegalArgumentException("Unsupported sample encoding." + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT.")); throw new IllegalArgumentException("Unsupported sample encoding." + " Should be ENCODING_PCM_8BIT or ENCODING_PCM_16BIT."); } //-------------- // audio load mode if ( (mode != MODE_STREAM) && (mode != MODE_STATIC) ) { throw(new IllegalArgumentException("Invalid mode.")); throw new IllegalArgumentException("Invalid mode."); } else { mDataLoadMode = mode; } Loading Loading @@ -487,7 +487,7 @@ public class AudioTrack int frameSizeInBytes = mChannelCount * (mAudioFormat == AudioFormat.ENCODING_PCM_8BIT ? 1 : 2); if ((audioBufferSize % frameSizeInBytes != 0) || (audioBufferSize < 1)) { throw (new IllegalArgumentException("Invalid audio buffer size.")); throw new IllegalArgumentException("Invalid audio buffer size."); } mNativeBufferSizeInBytes = audioBufferSize; Loading Loading @@ -894,7 +894,7 @@ public class AudioTrack public void play() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("play() called on uninitialized AudioTrack.")); throw new IllegalStateException("play() called on uninitialized AudioTrack."); } synchronized(mPlayStateLock) { Loading @@ -914,7 +914,7 @@ public class AudioTrack public void stop() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("stop() called on uninitialized AudioTrack.")); throw new IllegalStateException("stop() called on uninitialized AudioTrack."); } // stop playing Loading @@ -934,7 +934,7 @@ public class AudioTrack public void pause() throws IllegalStateException { if (mState != STATE_INITIALIZED) { throw(new IllegalStateException("pause() called on uninitialized AudioTrack.")); throw new IllegalStateException("pause() called on uninitialized AudioTrack."); } //logd("pause()"); Loading