Skip to content
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

Open
rjsachse opened this issue Apr 7, 2024 · 21 comments
Open

[FEATURE REQUEST] I2S Speaker Output #404

rjsachse opened this issue Apr 7, 2024 · 21 comments

Comments

@rjsachse
Copy link
Contributor

rjsachse commented Apr 7, 2024

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...

@s60sc
Copy link
Owner

s60sc commented Apr 7, 2024

could you give a more specific use case for the speaker.

@rjsachse
Copy link
Contributor Author

rjsachse commented Apr 7, 2024

Some Ideas

  1. Doorbell camera. Push button and plays a selectable doorbell chime sound.
  2. Doorbell camera with 2 way audio so you can talk to the person at the door
  3. Intercom so one mjpeg2sd could talk to another in a different room
  4. Pet camera so when your away you can see and talk to your pets
  5. Application voice feedback like Wifi Connected, camera recording etc.
  6. Surveillance camera with human voice deterrent pre recorded like "Recording Started"
  7. Make car/truck/tank sounds like a horn or rev engine through remote control
  8. Robot with vision, hearing and a voice in 1 perfect package

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.
Using a i2s MAX98357A amp board. Would only need 1 extra pin if using with i2s mic too

Off Topic.
I am starting to get my head around your code and started to add a oled screen, hlk-ld2410 radar, also updated telemetry.cpp to use just BME280 or BMP280 or GY91 not conflicting, not sure if you wanted a pull request or leave telemetry.cpp as a user edit. Happy to help in anyway I can.

@s60sc
Copy link
Owner

s60sc commented Apr 8, 2024

I'll start with browser on mic enabled pc to send stream to esp32

telemetry.cpp intended as a user edit

@Ritashaiev
Copy link

Ritashaiev commented Apr 23, 2024

what pins are you using for for i2s on esp32s3 cam wroom?

@rjsachse
Copy link
Contributor Author

You can pretty much use any free pins for i2s

@Ritashaiev
Copy link

Ritashaiev commented Apr 24, 2024

You can pretty much use any free pins for i2s

i tried a couple but some of them not quite ideal.
i modify them in the menu but there's what i got:
pin 14 may cause the led out of control
pin 3 or 4 may interrupt the camera
it worked immediately after pressing the reset button, but not working after a reboot
pin 46/47/21 works but it only records sound in the first 3 seconds
i will try other pins later or maybe reinstall the app

@rjsachse
Copy link
Contributor Author

What is the pin map of your board. Sorry I don't have that board.

@Ritashaiev
Copy link

Ritashaiev commented Apr 24, 2024

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
i bought the esp32s3 from the link
images
i don't know if this pin map is correct, the board looks the same

@rjsachse
Copy link
Contributor Author

Are you talking about microphone or speaker

@Ritashaiev
Copy link

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

@rjsachse
Copy link
Contributor Author

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

@Ritashaiev
Copy link

the tricky thing is when i used pin14 it kept led on. idk why

@rjsachse
Copy link
Contributor Author

Wrong place for issue. Create a issue, if there is a issue with a selected board in appGlobals.h

@s60sc
Copy link
Owner

s60sc commented May 4, 2024

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

@rjsachse
Copy link
Contributor Author

rjsachse commented May 5, 2024

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.

@s60sc
Copy link
Owner

s60sc commented May 5, 2024

Sorry, I did that to hide the parameters so it wouldn't confuse anyone else, in your copy change 9 to 3

@rjsachse
Copy link
Contributor Author

rjsachse commented May 9, 2024

Glad I worked it out lol, sorry not going to be able to test till about Sunday

@rjsachse
Copy link
Contributor Author

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
[14:39:24.739 ERROR @ webServer.cpp:413] websocket receive failed with ESP_ERR_INVALID_STATE

@s60sc
Copy link
Owner

s60sc commented May 11, 2024

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.

@rjsachse
Copy link
Contributor Author

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

@s60sc
Copy link
Owner

s60sc commented May 18, 2024

Voicechanger v1.3 uploaded.

Clock pin can be shared if compatible, eg mic I2S SCK & amp I2S BCLK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants