Teensy 3.1 and WaveHC

Status
Not open for further replies.

Teenfor3

Well-known member
I am new to Teensy but used arduino uno before and had the Uno and the Wave shield working playing audio files or parts of files depending on what was happening on the inputs of various I/O pins.
I tried compiling the sketch with the board set as Teensy3.1 and got the following error

C:\Program Files\Arduino\libraries\WaveHC\WaveHC.cpp:41:4: error: expected constructor, destructor, or type conversion before '(' token

Is there anywhere I can get documents that list these types of error and how to compare devices and correct them. What does the 41:4 mean. Below is copy of line 41 in WaveHC.ccp...???

// timer interrupt for DAC
ISR(TIMER1_COMPA_vect) {

When I set the board as Teensy2 I dont get the error and the sketch compiles and brings up the teensy loader. I dont have a teensy 2 to try if it works. I assume it wouldnt work in teensy3.1. I have a Teensy3.1 and need it to work on 3.1.

I assume the problem is calling things by the correct name and using the correct pin outs etc

Is there a folder somewhere of Teensy library files or has Teensy just modified the existing Arduino library files..??

Any help appreciated, Thanks
 
The Adafruit wave shield is an odd choice. Its large (formfactor for Arduino Uno), not especially powerful, and plays 22KHz, 12bit, mono Wave (.wav) files. The dates on the library indicate that it was last touched on Sept 2011. It looks as if only AVR processors are supported.

The Teensy 3.1 already has a DAC on board so you could play mono sounds with no expansion. There is also the audio adapter board which is a lot more powerful than the wave shield; the audio library works well with Teensy 3.1.
 
nantonos is right.. a pure Teensy3.1 will allready sound better than the WaveHC. You only need a storage if you want longer pieces of music to play, so than you might just as well get the audio adapter, that has a SD card slot and gives even better stereo sound.
 
Thanks for the replies. Yes, I see the Teensy3.1 will probably be faster, more compact and more ports etc. I had the wave shield playing files, also fast forward and reverse using "seek" within a playing file controlled by signals on the I/O pins. I basically want to start with the Teensy doing something similar. That is why I tried to start with the sketch I had for the wave shield. I am a wee bit lost in the Teensy stuff, I clicked on your link to the Audio Library and see a whole lot of files and sketches etc. Do I have to download the Audio Library from somewhere and put it in the Arduino library folder. I see ref to Audio.h, SDfat etc will these have similar functions as play, seek, Fast forward etc. Is ther any docs on this stuff. Basically I want to read from SD card, play it, pause, seek etc and output to analogue and also I2S for link to other devices.
Thanks for your help
 
The audio library does most of this, at much better quality, but the WAV player object currently doesn't have seeking.

I'll put that on my TODO list, but it may be a while until I can get to it....
 
Thanks for reply, If it is fast enough to stop playing one file and very quickly go to play another then "seek" may not be needed, but I imagine seek within a file would be faster to get to the next sound with several sounds saved in the one file. I have the audio adaptor board and the teensy3.1 so will try to get that going first. What is the best example sketch to try out first.?? and I am still not sure where to get the Audio library. I go to your GitHub page and see a lot of files/links. Over at the Right hand side is a Zip download. I downloaded that and copied the Audio-master folder to the Arduino Library folder. I had to rename the folder Audio_master. Is this correct..????
 
Thanks for reply, If it is fast enough to stop playing one file and very quickly go to play another then "seek" may not be needed, but I imagine seek within a file would be faster to get to the next sound with several sounds saved in the one file.

Actually, opening a new file might be faster. FAT filesystems require traversing the FAT cluster chain to seek. Not a big deal if the file is contiguous on the media, but slow if there's fragmentation.

I can tell you one thing for certain: Teensy 3.1 will do it a LOT faster than Arduino Uno!

If you're looking to transition between multiple sounds, the audio library can do some pretty awesome things for you. For example, you can create 2 player objects (assuming you have a good quality SD card that can keep up) and feed each player through a fader object, and run those to a mixer that goes to the output. Then you can start playing the next sound early and fade the old one out while fading the new one in.

I have the audio adaptor board and the teensy3.1 so will try to get that going first. What is the best example sketch to try out first.??

PlayWavFromSdCard

and I am still not sure where to get the Audio library. I go to your GitHub page and see a lot of files/links. Over at the Right hand side is a Zip download. I downloaded that and copied the Audio-master folder to the Arduino Library folder. I had to rename the folder Audio_master. Is this correct..????

Yes, that's fine. If it's showing up in File > Examples, then you put it in the right place.
 
I am a wee bit lost in the Teensy stuff, I clicked on your link to the Audio Library and see a whole lot of files and sketches etc. Do I have to download the Audio Library from somewhere and put it in the Arduino library folder.

On the page I linked to
http://www.pjrc.com/teensy/td_libs_Audio.html

there is a download link, which takes you to
https://github.com/PaulStoffregen/Audio

which has a "download zip" button. Download and extract the zip to your libraries folder. You need to remove the "-master" part of the directory name as Arduino libraries can't have a hyphen in them for some reason.
 
Yes, thanks for your help, found the Zip file and changed the name OK....now putting it together to get it working...
I can find the schematics and pinouts etc for the Teensy3.1 and the SD adaptor in the reference section, but it is the Audio adaptor I am using....Is there a schematic for the Audio adaptor board..??.
I can find the audio adaptor pinouts and a description page but cannot find a schematic..??
Does the Teensy3.1 power the Audio board from the USB socket via the "on cpu chip" 3.3v regulator...so all I have to do is plug it in..??...It says 100 mA max....??
Does the PlayWavSdCard sketch setup all the pins etc required, as per pins layout on the audio board....??... No need to change anything..??
I attempted to compile and download the sketch to the Teensy3.1 without the audio board attached and it didnt seem to download correctly. It asked me to press the reset button, I pressed the button on the teensy but didnt download. Now I cant get even the blink sketch to download. Is there a reset that is different from pressing the button to download...???
 
Further to my last post, I have discovered the Teensy3.1 is not staying detected by windows system devices. The the Teensy shows as two or more HID devices, then at random the PC sounds "boinks" and the the devices drop from the list in system devices. This upsets the downloading. but I have actually got the Blink sketch downloaded again and it flashes OK while the HID devices stay detected in system devices. If they drop from system devices, the LED stops blinking. Even when the IDE is not open or the Loader is not running. Nothing running except the Teensy plugged into USB port. I have been searching and found some things to try but didnt fix the problem....any help appreciated please.. I am running Windows XP sp3.
 
If they drop from system devices, the LED stops blinking. Even when the IDE is not open or the Loader is not running. Nothing running except the Teensy plugged into USB port.

My first guess, from only this message, would be to check the power. A voltmeter on VUSB or VIN (they're the same by default) should confirm is Teensy is getting a reliable 5V from your computer.

The next easy thing to check is whether it can remain running and blinking (no reprogramming, simple plugged in to a USB port to get power) on different computers, or even from a USB charger.
 
Checked power when plugged into PC USB.... 4.96 volts appears stable acording to meter.
Teensy 3.3 volt pin measures 3.29 volt stable.

Plugged Teensy into a USB charger Vin measures 5.25 volt and Teensy 3.3V pin measures 3.29/3.3 volt.
When plugged into charger the LED flashes randomly as it does when plugged in PC USB.
I started another thread regarding the Windows USB programing problem as I think it is not related to playing wav...
 
When plugged into charger the LED flashes randomly as it does when plugged in PC USB.

This board has been programmed with the simple LED blink, right? If so, then the hardware is probably damaged or defective. Please email me directly (paul at pjrc dot com) with a link to this thread and info about where you purchased this board.
 
Status
Not open for further replies.
Back
Top