GithubHelp home page GithubHelp logo

arduinosound's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinosound's Issues

Flipping stereo channels

I’m using Arduino MKR Zero with Adafruit UDA1334A breakout, when I play wav file which contain binaural audio, left and right channels are randomly switching their places. I’m using provided wav file example and reading wav file from sd card. Audio file is created in audacity and plays back on pc as intended. Any Ideas?

ICS43432 I2S sound recording and playback

Thank you for your Arduino Sound library. So far I can output the amplitude and spectrum measured with the ICS43432 on the serial monitor but this is not particularly useful. I would like to be able to record the time history of the spectrum, capture normal modes, plot them versus time, etc. It's hard to do this on the serial monitor. I would really like to find a way to capture the data for later analysis and playback. I am thinking I will use an SPI NOR flash for this. I have one I can attach to the MCU that has either 16 or 128 MByte of memory. This ought to be enough for small snippets of sound capture.

What I would really like to do is to record sound from the ICS43432 I2S microphone attached to my STM32L4 MCU, store the data stream on a connected SPI NOR Flash or SD card, and then play it back via PWM tone or the dual DAC, etc.

I must have a mental block or something because I just can't seem to figure out how to capture the I2S data fast enough and more particularly, how to play it back.

Do you have any example using your sound library or otherwise that demonstrates how to capture and play back the I2S sound recorded from the ICS43432 microphone?

Perhaps it would be worthwhile to add another API to the ArduinoSound library to allow capture and playback of I2S data...

24bit I2S mic support

Hello,
I've been using an I2S mic breakout board from Adafruit (SPH0645LM4H) https://www.adafruit.com/product/3421 and using the library successfully, however, while reading the datasheet (http://www.knowles.com/kor/content/download/5988/105771/version/4/file/SPH0645LM4H-BRevB.PDF) (page 3) I found that the actual output of the mic is 24bit rather than 32bit. Is there a possibility to add a 24bit option?

I've been inspecting the library and I could gladly help adding the option so it's available for everyone.

Thank you.

Xavier

DMAC Handler Error

Hi,

I tried compiling this on two differnt computers with both a Bluefruit M0 Feather as well as a ItsyBitsy M0.

In both cases I get this:

libraries/Adafruit_ZeroDMA/Adafruit_ZeroDMA.cpp.o: In function DMAC_Handler': Adafruit_ZeroDMA.cpp:(.text.DMAC_Handler+0x0): multiple definition of DMAC_Handler'
libraries/I2S/utility/DMA.cpp.o:DMA.cpp:(.text.DMAC_Handler+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit Feather M0.

Any idea how to remedy this?

Missing includes arm_math.h

Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Uno"

In file included from /Users/user/Documents/Arduino/sketch_apr26a/libraries/ArduinoSound-master/src/ArduinoSound.h:28:0,
from /Users/user/Git/audio_sensor/audio_library_test/audio_library_test.ino:1:
/Users/user/Documents/Arduino/sketch_apr26a/libraries/ArduinoSound-master/src/AmplitudeAnalyzer.h:25:22: fatal error: arm_math.h: No such file or directory
#include <arm_math.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

WAVE file header issue

ffmpeg on Linux adds a LIST section between fmt and data when converting an audio file to WAVE.

On the image below, you have the same file exported by ffmpeg on the left and Audacity on the right.
image

WAVE file with the LIST section don't work with the library right now.

there is no easy way with ffmpeg to remove this metadata. Getting this to work would allow a lot more files to work correctly with the library.

ICS43432 I2S - FFT Analysis

Hello,

Thank you very much for this library.
We are using it with an Arduino/Genuino Zero in order to develop applications for ambient noise frequency analysis, within the SmartCitizen project. We would like to perform FFT analysis on the new version of the kit and we found this library very useful.

However, we are finding some problems while trying to perform FFT analysis with sampling frequencies >30kHz and fftSizes = 64 (for 15kHz max frequency according to Nyquist Theorem). At some point during the acquisition and FFT calculation, it seems there is an Overload that provokes the execution to freeze. I am not sure of it being a memory Overload or other problem, so I give some details below of the case.

  • Arduino/Genuino Zero with the ICS43432 installed on a Breadboard
  • Execution of the example SpectrumSerialPlotter, although it also happens without the instruction fftAnalyser.read
  • For fftSizes = 64, it happens when the sampling frequency is >30kHz (and lower freq if fftSizes are higher)
  • Works finely at 8kHz - 15kHz, Although it sometimes has some issues when we have more frequencies implied (i.e. noises with broader spectrum effect)
  • I have tried to track the failure by inputing some Serial.println on the different classes / functions and the execution seems to freeze after the I2S callback to the AudioInI2SClass::OnReceive.

Would you kindly shed some light on this issue? Have you tried to perform tests at these frequencies levels?

My apologies for any bad explanation I might have provided, I hope it is somehow clear.
Thank you beforehand for your help,

Óscar

WavPlayback example will not recognize any wav files

I wired up the I2S MAX08357 breakout board to the MKZero and uploaded the WavPlayback from the https://github.com/arduino-libraries/ArduinoSound library. But somehow nothing useful happens.

If I use a wav file I get this:

Initializing SD card...initialization done.
wave file is invalid!

Disabling this check sheds some light on the issue:
Initializing SD card...initialization done.
Bits per sample = -1
Channels = -1
Sample rate = -1 Hz
Duration = 1 seconds
unable to play wave file using I2S!

This was with a mono, 8bit/sample wav file. OK, I tried a 16 bit mono, at least this file makes some sense to the parser...?
Bits per sample = 16
Channels = 1
Sample rate = 22050 Hz
Duration = 0 seconds
unable to play wave file using I2S!

If I go on and disable the sanity check this one file plays, not very clean, but at least something is coming out which is remotely like the sound I expect.

16bit stereo is again not recognized by the sketch...
Initializing SD card...initialization done.
Bits per sample = -1
Channels = -1
Sample rate = -1 Hz
Duration = 1 seconds
unable to play wave file using I2S!

To aggravate the problems, some 16bit/22050s/s/mono files will play, but not all of them, I cannot see the difference.

Any idea what do I do wrong?

Request - port for nrf52840 nordic semiconductor chip

Is your feature request related to a problem? Please describe.
I'm looking for a way to generate a reliable FFT from a PDM with minimal noise. I'd also like a way to get decibel measurements using the MP34DT05 on the Arduino Nano 33 BLE Sense.

Ideally the ArduinoSound library would be ported over to the nrf52840 chipset?

Describe alternatives you've considered
The PDM reading examples provided give a wave value, but I haven't been able to locate documentation for translating the read values into a reliable decibel reading.

Additional context
What are the roadblocks to porting the library?

Recording .wav files using I2S MEMS microphone SPH0645 and Arduino MKR1010

Respected All,
I want to record 10-20 seconds audio files in .wav format. The audio source is coming from the earpieces of a Stethoscope to convert a conventional stethoscope into a digital stethoscope.
I have connected the SPH0645LM4H-B Adafruit I2S digital microphone with Arduino MKR1010.

With the help of #2 (comment) by @sandeepmistry
I am able to see visually the audio data in serial plotter.

I want to store this audio recordings in .wav format in (say my computer drive) for further signal processing in Matlab.
Requesting help in this regard,

Thanking You

2 x I2S microphones Stereo configuration

Hi,
Thank you for this library.

I tried it with ICS-43432 and SPH0645 microphones and it works fine in MONO configuration.
I would like to use 2 of them in order to have a STEREO configuration :

image

Is there a way to differentiate the data coming from Right and Left channel ?

Thank you for your time.
Best regards, Mathieu.

Cue function not working

Don't know if I understood the cue() feature correct, but shouldnt it play a Song from the given time on? When I call it, it only replays the song from beginning!

Thats a part of my code:

void audioCue(int t){
  if(t>0 && t<currentAudioFile.duration()){
    currentAudioFile.cue(t);
    Serial.println("Set playback to:");
    Serial.println(currentAudioFile.currentTime());
  }else{
    Serial.println("Cued Time not valid");
  }
}

currentAudioFile is a global var holding the currently played wav file (type: SDWaveFile)

Raspberry Pi Pico support

Would this library work on an raspberry pi Pico?
It should be possible since it has an Arm Cortex-M0+ like the Mkr Zero!

Wave Playback as Slave

Hi,

Thank you for producing this library, it has proved very useful for my latest project. At the moment I cannot seem to find a way to play back a wave file on an SD card via I2S with the arduino (MKR Zero) behaving as the slave to my DSP (ADAU1701). Ideally I would like the DSP to provide the master I2S clock.

Can this be achieved somehow?

Many thanks,

Edd Perks

zero value buffer occasionally appears in I2S reading

Hi,

When I modify the arduinosound library for my own operation, I found a wired issue.

I read the AmplitudeAnalyzer::update(const void* buffer, size_t size) function play the key role for further operation with I2S reading data. And the easiest way is to modify the rms functions: arm_rms_q31((q31_t*)buffer, size / 4, (q31_t*)&analysis)

But when I simply change the above sentence to

q31_t* tmp = (q31_t*)buffer;
_analysis = *tmp;

There appears zero value buffer occasionally (sometimes correct, but sometimes only shows zeros through serial print. And it will turn to zero and then turn to correct values).

I am not sure what is the problem cause I didn't change other logic in ArudioSound. Is there other magic in the rms functions?

Support nRF52 based boards and I2S amp

Hi Sandeep,
I've seen you released quite many great additions to support boards with nRF52 from Nordic, like the Adafruit BLE Feather.

Do you plan to adapt this library to support the nRF52 platform too?

The chipset seems to be very popular due to its powerful architecture and flexible pin configurations, not to mention the EasyDMA also for I2S. I already use the BLE Feather with a MAX98357A Breakout and this library offers the infrastructure to read data from SD-card and stream it to an audio amp. Frankly I do not know how much effort it would be to tweak the code to support nRF52, but since you already have extensive experience with that platform and knowing your skills from other libraries for nRF52 you are the best guy for the job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.