Home
last modified time | relevance | path

Searched refs:sampleRate (Results 1 – 25 of 36) sorted by relevance

12

/cts/tests/tests/media/src/android/media/cts/
DAudioTrackNative.java46 public boolean open(int numChannels, int sampleRate, boolean useFloat, int numBuffers) { in open() argument
47 return open(numChannels, 0, sampleRate, useFloat, numBuffers); in open()
50 public boolean open(int numChannels, int channelMask, int sampleRate, in open() argument
53 sampleRate, useFloat, numBuffers) == STATUS_OK) { in open()
118 public static boolean test(int numChannels, int sampleRate, boolean useFloat, in test() argument
120 return test(numChannels, 0, sampleRate, useFloat, msecPerBuffer, numBuffers); in test()
123 public static boolean test(int numChannels, int channelMask, int sampleRate, boolean useFloat, in test() argument
125 return nativeTest(numChannels, channelMask, sampleRate, useFloat, msecPerBuffer, numBuffers) in test()
154 int sampleRate, boolean useFloat, int numBuffers); in nativeOpen() argument
171 int numChannels, int channelMask, int sampleRate, in nativeTest() argument
DAudioRecordNative.java44 public boolean open(int numChannels, int sampleRate, boolean useFloat, int numBuffers) { in open() argument
45 return open(numChannels, 0, sampleRate, useFloat,numBuffers); in open()
48 public boolean open(int numChannels, int channelMask, int sampleRate, in open() argument
51 sampleRate, useFloat, numBuffers) == STATUS_OK) { in open()
116 public static boolean test(int numChannels, int sampleRate, boolean useFloat, in test() argument
118 return test(numChannels, 0, sampleRate, useFloat, msecPerBuffer, numBuffers); in test()
121 public static boolean test(int numChannels, int channelMask, int sampleRate, boolean useFloat, in test() argument
123 return nativeTest(numChannels, channelMask, sampleRate, useFloat, msecPerBuffer, numBuffers) in test()
152 int sampleRate, boolean useFloat, int numBuffers); in nativeOpen() argument
170 int numChannels, int channelMask, int sampleRate, in nativeTest() argument
DAudioHelper.java64 public static byte[] createSoundDataInByteArray(int bufferSamples, final int sampleRate, in createSoundDataInByteArray() argument
66 final double rad = 2 * Math.PI * frequency / sampleRate; in createSoundDataInByteArray()
68 sweep = Math.PI * sweep / ((double)sampleRate * vai.length); in createSoundDataInByteArray()
77 public static short[] createSoundDataInShortArray(int bufferSamples, final int sampleRate, in createSoundDataInShortArray() argument
79 final double rad = 2 * Math.PI * frequency / sampleRate; in createSoundDataInShortArray()
81 sweep = Math.PI * sweep / ((double)sampleRate * vai.length); in createSoundDataInShortArray()
88 public static float[] createSoundDataInFloatArray(int bufferSamples, final int sampleRate, in createSoundDataInFloatArray() argument
90 final double rad = 2 * Math.PI * frequency / sampleRate; in createSoundDataInFloatArray()
92 sweep = Math.PI * sweep / ((double)sampleRate * vaf.length); in createSoundDataInFloatArray()
283 public TimestampVerifier(@Nullable String tag, @IntRange(from=4000) int sampleRate) { in TimestampVerifier()
[all …]
DAudioTrackSurroundTest.java199 private static AudioTrack createAudioTrack(int sampleRate, int encoding, int channelConfig) { in createAudioTrack() argument
202 sampleRate, channelConfig, in createAudioTrack()
207 sampleRate, channelConfig, in createAudioTrack()
239 void checkIndividualTimestamps(int sampleRate) { in checkIndividualTimestamps() argument
262 / sampleRate; in checkIndividualTimestamps()
271 + ", srate = " + sampleRate in checkIndividualTimestamps()
329 SamplePlayerBase(int sampleRate, int encoding, int channelConfig) { in SamplePlayerBase() argument
330 mSampleRate = sampleRate; in SamplePlayerBase()
458 SamplePlayerShorts(int sampleRate, int encoding, int channelConfig) { in SamplePlayerShorts() argument
459 super(sampleRate, encoding, channelConfig); in SamplePlayerShorts()
[all …]
DNonBlockingAudioTrack.java48 public NonBlockingAudioTrack(int sampleRate, int channelCount, boolean hwAvSync, in NonBlockingAudioTrack() argument
67 sampleRate, in NonBlockingAudioTrack()
76 sampleRate, in NonBlockingAudioTrack()
91 .setSampleRate(sampleRate) in NonBlockingAudioTrack()
97 mSampleRate = sampleRate; in NonBlockingAudioTrack()
DCodecState.java284 int sampleRate = in onOutputFormatChanged() local
291 " sampleRate:" + sampleRate + " channels:" + channelCount); in onOutputFormatChanged()
297 sampleRate < 8000 || sampleRate > 128000) { in onOutputFormatChanged()
300 mAudioTrack = new NonBlockingAudioTrack(sampleRate, channelCount, in onOutputFormatChanged()
DAudioNativeTest.java340 int numChannels, int sampleRate, boolean useFloat, in doRecordTest() argument
345 assertTrue(TEST_NAME, record.open(numChannels, sampleRate, useFloat, in doRecordTest()
350 (int)((long)sampleRate * segmentDurationMs * numChannels / 1000); in doRecordTest()
DEncoderTest.java305 int sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE); in testEncoder() local
307 int inBitrate = sampleRate * channelCount * 16; // bit/sec in testEncoder()
315 "-" + sampleRate + "Hz-" + channelCount + "ch-" + outBitrate + in testEncoder()
365 (long)numBytesSubmitted * 1000000 / (2 * channelCount * sampleRate); in testEncoder()
DAudioTrackLatencyTest.java125 public int sampleRate = 48000; field in AudioTrackLatencyTest.TestSetup
142 int minBufferSize = AudioTrack.getMinBufferSize(sampleRate, config, format); in createTrack()
147 mTrack = new AudioTrack(streamType, sampleRate, config, format, in createTrack()
186 int millis = (framesRemaining * 1000) / sampleRate; in writeSeconds()
227 + (several * framesWrittenTotal * MILLIS_PER_SECOND / setup.sampleRate); in testPlaySmallBuffer()
DMediaCodecCapabilitiesTest.java895 for(int sampleRate : validSampleRates) { in testIsSampleRateSupported()
896 Log.d(TAG, "SampleRate = " + sampleRate); in testIsSampleRateSupported()
898 audioCap.isSampleRateSupported(sampleRate)); in testIsSampleRateSupported()
901 for(int sampleRate : invalidSampleRates) { in testIsSampleRateSupported()
902 Log.d(TAG, "SampleRate = " + sampleRate); in testIsSampleRateSupported()
904 audioCap.isSampleRateSupported(sampleRate)); in testIsSampleRateSupported()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/
DStreamRecorder.java59 public static int calcNumBufferBytes(int numChannels, int sampleRate, int encoding) { in calcNumBufferBytes() argument
64 numBytes = AudioRecord.getMinBufferSize(sampleRate, AudioFormat.CHANNEL_IN_STEREO, in calcNumBufferBytes()
68 numBytes = AudioRecord.getMinBufferSize(sampleRate, in calcNumBufferBytes()
75 public static int calcNumBufferFrames(int numChannels, int sampleRate, int encoding) { in calcNumBufferFrames() argument
76 return calcNumBufferBytes(numChannels, sampleRate, encoding) / in calcNumBufferFrames()
119 private boolean open_internal(int numChans, int sampleRate) { in open_internal() argument
121 mSampleRate = sampleRate; in open_internal()
155 public boolean open(int numChans, int sampleRate, int numBurstFrames) { in open() argument
156 boolean sucess = open_internal(numChans, sampleRate); in open()
DStreamPlayer.java90 private static int calcNumBufferBytes(int sampleRate, int numChannels, int encoding) { in calcNumBufferBytes() argument
91 return AudioTrack.getMinBufferSize(sampleRate, in calcNumBufferBytes()
96 private static int calcNumBufferFrames(int sampleRate, int numChannels, int encoding) { in calcNumBufferFrames() argument
97 return calcNumBufferBytes(sampleRate, numChannels, encoding) in calcNumBufferFrames()
106 public boolean open(int numChans, int sampleRate, int numBurstFrames, AudioFiller filler) { in open() argument
111 mSampleRate = sampleRate; in open()
115 calcNumBufferFrames(sampleRate, numChans, AudioFormat.ENCODING_PCM_FLOAT); in open()
DWaveTableFloatFiller.java51 public void setSampleRate(float sampleRate) { in setSampleRate() argument
52 mSampleRate = sampleRate; in setSampleRate()
/cts/tests/media/src/android/mediav2/cts/
DEncoderProfileLevelTest.java415 private LevelLimitVP9(int level, long sampleRate, int size, int breadth, in getMinLevelVP9() argument
418 this.sampleRate = sampleRate; in getMinLevelVP9()
425 private final long sampleRate; in getMinLevelVP9() field in EncoderProfileLevelTest.LevelLimitVP9
447 int sampleRate = size * frameRate; in getMinLevelVP9() local
450 if (sampleRate <= levelLimitsVP9.sampleRate && size <= levelLimitsVP9.size && in getMinLevelVP9()
461 private LevelLimitMPEG2(int level, long sampleRate, int width, int height, in getMinLevelMPEG2() argument
464 this.sampleRate = sampleRate; in getMinLevelMPEG2()
472 private final long sampleRate; in getMinLevelMPEG2() field in EncoderProfileLevelTest.LevelLimitMPEG2
487 int sampleRate = size * frameRate; in getMinLevelMPEG2() local
489 if (sampleRate <= levelLimitsMPEG2.sampleRate && width <= levelLimitsMPEG2.width && in getMinLevelMPEG2()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/
DWavAnalyzer.java13 private final int sampleRate; // Recording sampling rate. field in WavAnalyzer
25 public WavAnalyzer(byte[] byteData, int sampleRate, Listener listener) { in WavAnalyzer() argument
27 this.sampleRate = sampleRate; in WavAnalyzer()
135 + Util.toLength(Common.PREFIX_LENGTH_S + Common.PAUSE_AFTER_PREFIX_DURATION_S, sampleRate); in measurePipStrength()
137 listener.sendMessage("Prefix starts at " + (double) dataStartI / sampleRate + " s \n"); in measurePipStrength()
138 if (dataStartI > Math.round(sampleRate * (Common.PREFIX_LENGTH_S in measurePipStrength()
161 -2.0 * Math.PI * freq / sampleRate).exp(); in measurePipStrength()
189 + Util.toLength(i * (Common.PIP_DURATION_S + Common.PAUSE_DURATION_S), sampleRate); in measurePipStrength()
198 -2.0 * Math.PI * Common.FREQUENCIES[i] / sampleRate).exp(); in measurePipStrength()
224 int fftSize = Util.nextPowerOfTwo((int) Math.round(sampleRate * (Common.PREFIX_LENGTH_S in alignData()
DAudioRecordHelper.java28 private final int sampleRate; field in AudioRecordHelper
56 sampleRate = tmpSampleRate; in AudioRecordHelper()
58 Log.d(TAG, "Sample rate = " + sampleRate + "Hz, Source = " in AudioRecordHelper()
76 audioRecord = new AudioRecord(source, sampleRate, CHANNEL, ENCODING, bufferSize); in start()
121 return sampleRate; in getSampleRate()
DUtil.java17 public static int toLength(double duration, int sampleRate) { in toLength() argument
18 return (int) Math.round(duration * sampleRate); in toLength()
DHifiUltrasoundTestActivity.java302 private void play(byte[] data, int sampleRate) { in play() argument
308 sampleRate, AudioFormat.CHANNEL_OUT_MONO, in play()
310 sampleRate, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT)), in play()
/cts/tests/tests/nativemedia/aaudio/jni/
Dutils.cpp89 aaudio_direction_t direction, int32_t sampleRate, in StreamBuilderHelper() argument
93 mRequested{sampleRate, channelCount, dataFormat, sharingMode, perfMode},
112 AAudioStreamBuilder_setSampleRate(mBuilder, mRequested.sampleRate); in initBuilder()
143 mActual.sampleRate = AAudioStream_getSampleRate(mStream); in createAndVerifyStream()
144 ASSERT_GE(mActual.sampleRate, 44100); in createAndVerifyStream()
145 ASSERT_LE(mActual.sampleRate, 96000); // TODO what is min/max? in createAndVerifyStream()
167 mActual.sampleRate * sMaxFramesPerBurstMs.at(mActual.perfMode) / MILLIS_PER_SECOND; in createAndVerifyStream()
Dtest_aaudio.cpp75 const int32_t framesPerMsec = actual().sampleRate / MILLIS_PER_SECOND; in SetUp()
87 const int32_t framesToRecord = actual().sampleRate; // 1 second in TEST_P()
111 const int32_t framesToRecord = actual().sampleRate / 8; in TEST_P()
130 const int32_t framesToRecord = actual().sampleRate / 10; // 1/10 second in TEST_P()
223 writeLoops = 1 * actual().sampleRate / framesPerBurst(); // 1 second in TEST_P()
226 actual().sampleRate); // N bursts in TEST_P()
325 writeLoops = 1 * actual().sampleRate / framesPerBurst(); // 1 second in TEST_P()
331 actual().sampleRate); in TEST_P()
Dutils.h35 int32_t sampleRate; member
69 StreamBuilderHelper(aaudio_direction_t direction, int32_t sampleRate,
Dtest_aaudio_stream_builder.cpp159 const int32_t sampleRate = GetParam(); in TEST_P() local
160 const bool isSampleRateValid = isValidSamplingRate(sampleRate); in TEST_P()
163 if (isSampleRateValid && isLowRamDevice() && (sampleRate > 192000)) { in TEST_P()
168 AAudioStreamBuilder_setSampleRate(aaudioBuilder, sampleRate); in TEST_P()
/cts/tests/tests/media/libaudiojni/
Daudio-record-native.cpp82 uint32_t sampleRate, in open() argument
125 pcm.sampleRate = sampleRate * 1000; in open()
173 mBufferSize = (BUFFER_SIZE_MSEC * sampleRate / 1000) in open()
468 jint numChannels, jint channelMask, jint sampleRate, in Java_android_media_cts_AudioRecordNative_nativeTest() argument
472 const size_t framesPerBuffer = msecPerBuffer * sampleRate / 1000; in Java_android_media_cts_AudioRecordNative_nativeTest()
477 res = record.open(numChannels, channelMask, sampleRate, useFloat, numBuffers); in Java_android_media_cts_AudioRecordNative_nativeTest()
515 jint numChannels, jint channelMask, jint sampleRate, jboolean useFloat, jint numBuffers) in Java_android_media_cts_AudioRecordNative_nativeOpen() argument
521 return (jint) record->open(numChannels, channelMask, sampleRate, useFloat == JNI_TRUE, in Java_android_media_cts_AudioRecordNative_nativeOpen()
Daudio-track-native.cpp74 jint sampleRate, jboolean useFloat, jint numBuffers) { in open() argument
110 pcm.sampleRate = sampleRate * 1000; in open()
379 jint numChannels, jint channelMask, jint sampleRate, jboolean useFloat, in Java_android_media_cts_AudioTrackNative_nativeTest() argument
384 const size_t framesPerBuffer = msecPerBuffer * sampleRate / 1000; in Java_android_media_cts_AudioTrackNative_nativeTest()
389 res = track.open(numChannels, channelMask, sampleRate, useFloat, numBuffers); in Java_android_media_cts_AudioTrackNative_nativeTest()
428 jint numChannels, jint channelMask, jint sampleRate, in Java_android_media_cts_AudioTrackNative_nativeOpen() argument
437 sampleRate, in Java_android_media_cts_AudioTrackNative_nativeOpen()
/cts/tests/tests/security/src/android/security/cts/
DAudioSecurityTest.java365 final int sampleRate = 48000; in testVisualizerCapture_CVE_2017_0396() local
370 final int bufferFrames = seconds * sampleRate; in testVisualizerCapture_CVE_2017_0396()
386 audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, in testVisualizerCapture_CVE_2017_0396()

12