-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] I2S Speaker Output #404
Comments
could you give a more specific use case for the speaker. |
Some Ideas
I know a few ideas could be classed as 1 but trying to give user cases. To be able to play sounds from sd card or stream to device, would be nice but both would be great. I know it could be difficult to implement. Think this would be a great next step into this project. Off Topic. |
I'll start with browser on mic enabled pc to send stream to esp32 telemetry.cpp intended as a user edit |
what pins are you using for for i2s on esp32s3 cam wroom? |
You can pretty much use any free pins for i2s |
i tried a couple but some of them not quite ideal. |
What is the pin map of your board. Sorry I don't have that board. |
Freenove ESP32-S3-WROOM CAM Board (Compatible with Arduino IDE), Onboard Camera Wireless, Python C Code, Detailed Tutorial, Example Projects https://amzn.asia/d/eibWUoQ |
Are you talking about microphone or speaker |
sry, microphone. i didn't think about using i2s as a speaker. maybe i reply in a wrong issue |
47,21,42,41,1,14 should be free pins according to pin map. Yes this a feature request for i2s speaker. Not issue about microphone, I have no issues with microphone that I have noticed |
the tricky thing is when i used pin14 it kept led on. idk why |
Wrong place for issue. Create a issue, if there is a issue with a selected board in appGlobals.h |
Implemented code in v9.7.1 to stream device microphone via browser to speaker on esp32. This works fine on my VoiceChanger app, but not on this app due to lag probably as too much else going on. The speaker code and notes is in audio.cpp |
For the life of me, I could not find the setting. Need to change appSpecific.cpp config going to submenu 9, not 3. Just found the issue, but there is no time to fix. |
Sorry, I did that to hide the parameters so it wouldn't confuse anyone else, in your copy change 9 to 3 |
Glad I worked it out lol, sorry not going to be able to test till about Sunday |
I had a quick go today. Sort of got it working through phone and pc, but the mic disconnects randomly and get this error message sometimes |
As before there is too much going on in the app to handle the input stream in a timely manner. May need a separate ESP32 dedicated to remote mic. I will be uploading the latest voicechanger app in a few days, could use that as a basis. |
Looking forward to trying the voicechanger app. Is there anyway to use the same serial clock and LR clock for both the mic and speaker like in this app esp32-walkie-talkie |
Voicechanger v1.3 uploaded. Clock pin can be shared if compatible, eg mic I2S SCK & amp I2S BCLK |
Seems to work OK. I get websocket errors sometimes. Still haven't had much time to play around with it as life gets in the way. Very thankful for what you have done, please don't remove code. |
Ok been having troubles getting this working again since arduino v3. Thought is was my amp board, waited for a new one, with the same result with the amp just playing a high pitch squeal. found a bug and created pull request. What was happening is that I have the i2s pins predefined in camera pins and found a issue in audio.cpp sd and ws pins was swapped. Haven't had a chance to see if it works yet. Also seems in the latest version the amp option is removed from web server |
I removed the amp option as it added clutter for something that few people would use as its too much work for the S3 with this app. Better to use a separate esp as an intercom. But if you can get it to work efficiently I'll reinstate it. |
sounds good, not necessarily want it as an intercom, just more want to play wav files from SD when recording starts, or motion detected like the buzzer but a voice saying recording. i do more PCB hardware than software and just want proof of concept to finalize my board first. made a test program to record a message and play it back, just looking at how to add it to this to see how it works |
Ok, I just re-added the amp settings back in and it works really good on arduino esp core v3. Did not run into any issues. Seems the new i2s driver is alot cleaner and faster. Maybe worth putting it back in? |
Does your fork include what youve tested. If so I'll try it out when I have time in the next couple of days |
I have a branch "audio" that has the amp output. Haven't uploaded the latest as im trying to play wav from sd card. Done a quick check today, seems better through IE than chrome. Seems there is a issue with the resample to 16hz too? The web audio api has a resample feature to lower the Hz's to 16000 now but only latest editions I think. Am thinking to create a python server that handles the streams and audio of multiple Only issue is time. Loving this project but hard too find the time Also do you know if there is a way to see what tasks are running? Not just the number of tasks running or what resources are left to use. (Sorry if off topic) |
Ok done a bit of a deep dive in web audio api. Should be able to change sample rate without a script. Hopefully have a working example with gain and visualisation in the next few weeks (time pending). Web audio api can do a fair bit with processing. Any tips in what you have learned would be great |
I have been looking at web audio api to stream to a PC speaker, so that an esp can act as one end of an intercom and a PC mic and speaker can act as the other end of the intercom, which will be incorporated in the voicechanger app. I've not had time to do much so far. The |
ok have put the remote code back in app and works good on my end, (my branch amp) just needed to increase mic gain. i am trying proof of concept at the moment so I can finish hardware design. haven't been able to get remote mic voice changer working yet. mic and amp work. my java script is a bit rusty been many years since last time coding in java, |
had a little bit of time today and tested the amp. works great like said previously have to increase mic gain the make amp louder. change some code in java to remove the resample and now just grabs at 16000. |
I have created a 2 way audio using websockets. The branch is here 2WayAudio works really good on my end haven't had much time to test though. Needing help with timing wondering is circularBuffer would help. If you are able to give a test and any suggestions on how to improve the code would be great. Just remember to change board and upload the new data Any feedback would be great. Would be great to see this implemented |
interesting, I'll make time in a couple of days |
sorry i have changed some code to clean up, still have some issue's with timing. ran out of time to look into further |
I've finished some other work, so can start to look at your code |
i just fixed the audio streaming jumpy when sending audio. the issue was it was sending data before it finished playing. |
The browser speaker tested ok, saves me a job as I much prefer C to javascript. |
Yer I understand that., I tried to just copy the style you had already. . It is still experimental and not sure how to do the webpage design for mic etc buttons. Was playing with volume visualisation and volume control on browser side, but might confuse people with there is 2 mic volume, 1 for device and other for browser. Maybe just simple buttons is best |
I've uploaded v10.2 with reworked audio.cpp and javascript |
haven't tested yet but noticed audio.cpp not updated still on ver10.0 |
found the issue there is 2 audio.cpp file one is Audio.cpp and the other is audio.cpp |
seems to work great beside the amp volume clips @ gain 4 so only under 3 works for me
so if ampVol = 0:
here is a logarithmic scale for both amplification and attenuation
unless i don't understand this correctly haven't tested yet |
at some point I will look at the Espressif Audio Development Framework |
I'm not sure if this is a too far stretch for the great project, but I think having a speaker will would be great.
either play audio through upd or wav from sd card, then would be able to make this the perfect project for a door cam or surveillance cam with 2 way audio and telemetry
just a idea...
The text was updated successfully, but these errors were encountered: