Porting Opus Audio Codec v1.2.1 to ESP32

1228panda
Posts: 3
Joined: Thu Jun 07, 2018 10:07 pm

Porting Opus Audio Codec v1.2.1 to ESP32

Postby 1228panda » Thu Jun 07, 2018 10:14 pm

Hello, currently I'm trying to port the Opus audio codec to the ESP32 as the main goal for my project, however I just recently started playing with my ESP-WROVER-KIT v3. I've gotten some examples to work, and hooked up a microphone+speaker which I have tested with the I2S-ADC-DAC example given in the esp-idf. I have an opus executable working on my Mac, which I'm developing on, and was wondering how to compile the opus files onto the esp-32 platform. To create the opus executable, they provide a configure script that generates a makefile for compiling the executable on your development platform, and obviously the Mac dependencies aren't the same as for an ESP32.

At the end, the task I want to achieve is using the microphone to record voice which is encoded + decoded through the opus codec, which would then be outputted through speakers.

I'm fairly new to this and any insight would be appreciated!

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: Porting Opus Audio Codec v1.2.1 to ESP32

Postby hassan789 » Sun Jun 10, 2018 5:28 am

hello... should be easy. Just use the esp32 compiler... check this example for esp8266:
https://www.esp8266.com/viewtopic.php?f ... t=4#p42633

1228panda
Posts: 3
Joined: Thu Jun 07, 2018 10:07 pm

Re: Porting Opus Audio Codec v1.2.1 to ESP32

Postby 1228panda » Mon Jun 11, 2018 5:03 pm

I tried doing the same as for the esp8266, except I get this error when I run the command:


./configure --host=xtensa-esp32-elf --target=xtensa-esp32-elf
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for xtensa-esp32-elf-strip... xtensa-esp32-elf-strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-apple-darwin16.7.0
checking host system type... xtensa-esp32-elf
checking how to print strings... printf
checking for style of include used by make... GNU
checking for xtensa-esp32-elf-gcc... xtensa-esp32-elf-gcc
checking whether the C compiler works... no
configure: error: in `/Users/Documents/opus-1.2.1':
configure: error: C compiler cannot create executables

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: Porting Opus Audio Codec v1.2.1 to ESP32

Postby hassan789 » Thu Jun 14, 2018 3:00 am


1228panda
Posts: 3
Joined: Thu Jun 07, 2018 10:07 pm

Re: Porting Opus Audio Codec v1.2.1 to ESP32

Postby 1228panda » Tue Jun 19, 2018 10:27 pm

Update: So I successfully compiled OPUS onto my ESP32, and now I'm testing how well the libraries work on the board.

Using the i2s_adc_dac example, I simply added an encoding + decoding step that reads from flash the recorded audio, encodes+decodes that, and puts the data back into the flash. When the DAC reads that decoded data, however, the output audio is much louder and filled with static. I can still discern what I had initially recorded through the ADC, but I'm confused as to why just encoding+decoding this input audio affects the output audio.

Who is online

Users browsing this forum: No registered users and 140 guests