Hi there,
I'm looking at as many examples I can but can't find the trick. My application needs to provide users with alternating tones in each ear via bluetooth. I think I've sorted the A2DP part with audio files but need to create tones 'on the fly' with varying frequencies which I plan to create with is DDS sine wave generator. I expect to feed a ring buffer with generated stereo samples assuming downstream decoding at 44100 16bits/sample but don't know how to feed the input stream.
Any pointers gratefully received.
Thanks
Filling pipeline with software generate sine wave
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Filling pipeline with software generate sine wave
You could modify this example: https://github.com/espressif/esp-idf/tr ... 2dp_source
The audio is generated in this function, so you could just replace that by a read from a queue or ring buffer. Have another task push the sine wave data into this queue/ringbuffer and you're done.
The audio is generated in this function, so you could just replace that by a read from a queue or ring buffer. Have another task push the sine wave data into this queue/ringbuffer and you're done.
Re: Filling pipeline with software generate sine wave
Thank you so much for your reply,
I guess I missed it as it doesn’t use a pipeline/stream.
Can I assume that the format is:
Sample Rate: 44100
Data size: 16 bits
Format: L-R. 16 bit little-endian?
Thank you again.
Colin
I guess I missed it as it doesn’t use a pipeline/stream.
Can I assume that the format is:
Sample Rate: 44100
Data size: 16 bits
Format: L-R. 16 bit little-endian?
Thank you again.
Colin
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Filling pipeline with software generate sine wave
From the existing function, it seems the samples are 16-bit little endian, but I'm not familiar enough with that code to tell you more about the other parameters, sorry.
Re: Filling pipeline with software generate sine wave
Thank you.
I can confirm that I have success delivering various tones to standard A2Dp headset at a sample rate of 44100.
The big problem now is that the after 110 seconds from connecting the A2DP disconnects - then reconnects for another 110 seconds and repeats. I have looked around the code and cannot find any built-in time limit lined to the a2dp source example. Is there a limit built in somewhere for the example code?
Thank you.
I can confirm that I have success delivering various tones to standard A2Dp headset at a sample rate of 44100.
The big problem now is that the after 110 seconds from connecting the A2DP disconnects - then reconnects for another 110 seconds and repeats. I have looked around the code and cannot find any built-in time limit lined to the a2dp source example. Is there a limit built in somewhere for the example code?
Thank you.
Re: Filling pipeline with software generate sine wave
Hello,
Did you find some solution to this timeout?
Thanks
Julien
Did you find some solution to this timeout?
Thanks
Julien
Who is online
Users browsing this forum: No registered users and 24 guests