Notifications
Clear all

Using a microphone and a speaker on a esp32

8 Posts
3 Users
0 Likes
436 Views
(@psychique)
New Member
Joined: 4 months ago
Posts: 1
Topic starter  

Hello i was wondering if someone could help me use a microphone on a esp32 and redirect the sound in a headset via the esp32. Some help would be much appreciated thanks.

I have already been able to use both of them separately by using the code and the explanations on dronebot's workshop website ( https://dronebotworkshop.com/esp32-i2s/ ), but i think that the libraries that are used won't let me make them work together. I started researching if there was anything on the net about it but i couldn't find anything. Also i am using vs code with platformIO. Also i won't be able to add a SD card because won't work with it.

We are also planning on using a potentiometer to make the volume go up or down.


   
Quote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@psychique Which libraries are you using, which do you think are in conflict? If the examples you are copying produce output to a speaker, then just replace the speaker with the headset. You might need to adjust some R in the circuit but it should work.

Who is we in 

We are also planning on using a potentiometer to make the volume go up or down.

 

 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
(@hzulu)
Eminent Member
Joined: 4 months ago
Posts: 16
 

@psychique The "swiss army knife" ( swiss is meant literally in this case 😉 ) for everything concerning I2S streaming, you'll find on
https://github.com/pschatzmann/ESP32-A2DP
I'm quite sure all your questions will be answered there.

There is also an explanation how to use those libraries with PlatformIO
https://github.com/pschatzmann/ESP32-A2DP/wiki/PlatformIO

Rule of Thumb in hardware/software engineering:
From the estimated time to complete a project you need:
5% for the engineering itself
95% securing everything against any strange idea users can have
and the remaining
150% for finding and fixing bugs that you thought never could happen


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@hzulu What a coincidence, two new users being helped by the same library in the last couple of days.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
(@hzulu)
Eminent Member
Joined: 4 months ago
Posts: 16
 

@zander Yes! what a coincidence... For the preparation of my own project's specification (details will come when I'm ready) I've studied all ESP32 I2S information I could get hold of. Phil Schatzmanns libraries are a piece of art.

Rule of Thumb in hardware/software engineering:
From the estimated time to complete a project you need:
5% for the engineering itself
95% securing everything against any strange idea users can have
and the remaining
150% for finding and fixing bugs that you thought never could happen


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@hzulu Agreed, I also have I2S etc. and especially Phil's libraries on my waaaaay too long to-do list. Being 81 with 2 or 3 failing body sub-systems and the fast-failing Canadian health system, I fear I will run out of time before I make any appreciable dent in my list, but I will try!

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
(@hzulu)
Eminent Member
Joined: 4 months ago
Posts: 16
 

@zander Wow!! I'm really impressed! According the huge amount of your contributions to this forum, I didn't expect you 81

Rule of Thumb in hardware/software engineering:
From the estimated time to complete a project you need:
5% for the engineering itself
95% securing everything against any strange idea users can have
and the remaining
150% for finding and fixing bugs that you thought never could happen


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5524
 

@hzulu I have slowed down a bit and have no training in anything after vacuum tubes. I have learned a teeny bit with the help of others here. However, basic troubleshooting techniques are the same as they always have been. Swap parts and observe which way the bug moves. Divide the project up into smaller parts and test each until one part shows a bug, then divide that one. Easy to do with software, a bit of trouble with hardware but technique #1 is the reverse, so it's all good with just those two time-proven approaches. 

My first computer was in 1959. My High School received an analogue computer from Ferranti Packard Canada. It couldn't do much more than move a needle on an analogue gauge, but it was a start.

 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote