Tympan / Tympan_Library

Arduino/Teensy Library for Tympan Open Source Hearing Aid
MIT License
124 stars 33 forks source link

unable to compile AudioPassThru example #70

Closed DD4WH closed 7 months ago

DD4WH commented 1 year ago

Hi Chip & Co-workers,

I am highly interested in purchasing a Tympan Rev E. While waiting for stock to become available again, I plan to try some of the code on a Teensy 4.0 with ADC PCM1808 and DAC5102a, a self-built mic preamp and two EM272 electret mics in stereo configuration.

I have Arduino & Teensyduino installed. The Tympan library was copied into my documents/Arduino/libraries folder.

When I try to compile the basic AudioPassThru example, I get the following error:

In file included from C:\Users\DD4WH\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2\cores\teensy4/WProgram.h:36:0,
                 from C:\Users\DD4WH\AppData\Local\Temp\arduino\sketches\7F807E1D7342C18C321FBAB04B0E9818/pch/Arduino.h:6,
                 from c:\Users\DD4WH\Documents\Arduino\libraries\Tympan_Library\src\AudioFeedbackCancelNLMS_F32.h:17,
                 from c:\Users\DD4WH\Documents\Arduino\libraries\Tympan_Library\src\AudioFeedbackCancelNLMS_F32.cpp:2:
c:\Users\DD4WH\Documents\Arduino\libraries\Tympan_Library\src\AudioFeedbackCancelNLMS_F32.cpp: In member function 'virtual void AudioFeedbackCancelNLMS_F32::receiveLoopBackAudio(float*, int)':
c:\Users\DD4WH\Documents\Arduino\libraries\Tympan_Library\src\AudioFeedbackCancelNLMS_F32.cpp:118:12: error: expected unqualified-id before '(' token
  if (!std::isfinite(x[i])) {
            ^
Multiple libraries were found for "SD.h"
  Used: C:\Users\DD4WH\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2\libraries\SD
  Not used: C:\Users\DD4WH\AppData\Local\Arduino15\libraries\SD
exit status 1

Compilation error: exit status 1

I tried different Arduino/Teensyduino versions, all give the same error.

Can somebody point me to what I am doing wrong?

Thanks in advance!

Regards, Frank

chipaudette commented 1 year ago

Hi Frank,

Sorry it's not working for you! This is one of our (my) newer additions to the library, so I shouldn't be surprised that someone is finding errors. It's annoying, though, when I'm not getting the same error.

Three thoughts:

Chip

DD4WH commented 1 year ago

Thanks Chip for your quick and concise response!

Now it compiles! BTW: I use Arduino 1.8.15 with TD1.54 :-)

Have to go to work now, will try other things later this week.

Thanks a lot !

Frank

chipaudette commented 1 year ago

I made the change via commit 33a9c2c

Hopefully this works for everyone else, too!

Chip

DD4WH commented 1 year ago

Thanks Chip! Here, I just deleted include <cfloat>. Just using include <cmath> instead works well here.

Tried out several examples, very impressive. I really like the PitchShift! I built a Stereo Version which makes spatial hearing of pitch-shifted bird songs possible. Will play around some more in the next days.

biomurph commented 1 year ago

@DD4WH Glad to hear you are up and running! We have good news, the Tympan RevE is slated to start a production run before the end of the year! I will be updating status on our Forum as the run takes shape.