As you might know, Android O AAudio is relatively new and there is not much documentation apart from the Android NDK AAudio API, which obviously isn't as good as Android SDK API. There is also googlesamples example of AAudio, but that is rather confusing because the AAudio write function is not being used. Is there somebody that have been doing this before that could provide an example of outputting AAudio with write, sinewave or some file (ex. .waw).Currently I have just created a stream, but there is no output since I haven't managed to use the write function. Thanks!
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/a5cf35ce-7e83-4d21-91ce-92f760c91622%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
1. Should I start a thread in the Java layer (where I will call the c++ function via JNI) or start the thread in the c++ code?
2. So the way I understand the while loop is: It loads the audioBuffer with data, and then it will write everything, and then start over. I assume this will run until I stop the while loop?
3. The way you render the data with generateTone: How do you do that if you just want a steady tone or something similar? And how would you do that with a .wav file?
And if a .wav file were to be played, I guess it would just start over and over until stopping it?
4. What is the purpose of the timeOutNanos and why the value 500000000? Would this be different if we use .wav file?
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/f039a477-c40e-429f-9aa3-b3744c8ad1e1%40googlegroups.com.
Also, for some reason the app crashes after playing and stopping a couple of times.
Den måndag 9 oktober 2017 kl. 09:41:34 UTC-4 skrev Martin:
result = AAudioStream_requestStart(stream);
while (playingAAudio && result == AAUDIO_OK) {float *data = audioBuffer;int phase = 0;
for (int i = 0; i < framesPerBurst*numChannels+1; i++) {
if(phase >2*M_PI) {phase + phase - (2*M_PI);
What should the amplitude be? I tried to set it to 20000 in;
*data++ = 20000*(sinf(i*2*M_PI*sineFreq/sampleRate))and I almost went deaf lol.And it never makes more than one while loop, AAUDIO_OK is turning false somehow.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/43d82642-977b-4a31-8002-d5e5f73369d5%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/e6d56f00-6796-490e-9e49-843bdebd4525%40googlegroups.com.