audio module ?

Status
Not open for further replies.

heliboy

Active member
I just got teensy 3.1 and it seems to work well. I also got the audio board. I expect it will output out the 3.5 mm jack. Is this correct ? I have not tried the audio library yet but maybe later today. Also, is the SD card accessable for data storage ? For example, can I use datalogger ?
 
I expect it will output out the 3.5 mm jack. Is this correct ?
Yes, and its output level can be controlled dynamically using the optional pot (or other pot). Several of the examples in the audiomaster library show how to do that.

Also, is the SD card accessable for data storage ? For example, can I use datalogger ?
Yes, BUT the SD card uses different pins than the standard SPI. See the PlayWavFromSdCard example for the necessary set up.
Also, the SD library works with the audio shield's SD card but I haven't been able to convince the SdFat library to work yet.

Pete
 
I can confirm that cardinfo in the SD library works. I was able to get sound output using the PlayFromSketch example so at least I know the hardware and the setup works. I was not able to get any output from the PLayWavFromSDCard sketch. I used cardinfo to make the sure an example WAV file was on the card and I used this Wav file name in the sketch. No sound ! Why ? I have another device sitting on the regular SPI 11,12,13 and CS on 6. Should I worry about this ? Why is the SDcard on nonstandard SPI ?
 
I used cardinfo to make the sure an example WAV file was on the card
What was its name and what directory was it in? You can only use filenames with 8.3 format.

I have another device sitting on the regular SPI 11,12,13 and CS on 6. Should I worry about this ?
If you want to use the audio at the same time, yes. The MCLK signal for the audio card is where the standard MOSI signal would be. There must be pin out limitations which dictate where some signals must be. At least the chip allows some signals to be reassigned to other pins.

Pete
 
Check the pinout diagram (you should also have received a physical printed copy with your teensy). The default pinouts are in black and the alternate pinouts in grey. The audio shield needs MCLK which would conflict with the default SPI pinout, so the audio library sets Teensy to use the alternate pinout. Your other SPI devices should thus use the alternate pinout as well. (With a different chip select, though - one pin per SPI device).
 
Yes, this is the best that can be done working within the available pin configurations. If you *really* want to dig into the pin config details, refer to the table on pages 207-209 of the reference manual.
 
Thanks for the advice. It seems that I just need some very short sound sequences. Few seconds each. The wav2sketch sketch works preety good but how did you convert the wav files to notes ? Maybe I could just store them in program memory.
 
Is it possible to store a short (2-3 sec) WAV (or MP3) file in teensy 3.1 flash ? How ? I figured from the forum that I should be able to use the audio library to play the wav file out the DAC and into a small audio amp. I have few teensies and SD adaptors headed my way so any help to get this going fast would be appreciated.
 
Is it possible to store a short (2-3 sec) WAV (or MP3) file in teensy 3.1 flash ?

Yes. In fact, at 11 kHz 8-bit ulaw encoded, you can have about 15 seconds. Or you can get a few seconds if you want full 16 bit, 44 kHz quality.


Use this program to convert WAV files to .CPP and .H files, which you simply drop in your sketch folder.

https://github.com/PaulStoffregen/Audio/blob/master/examples/PlayFromSketch/wav2sketch/wav2sketch.c

This example shows how it's done.

https://github.com/PaulStoffregen/Audio/blob/master/examples/PlayFromSketch/PlayFromSketch.ino
 
Status
Not open for further replies.
Back
Top