Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: A few questions before buying the Teensy Audio Adaptor Board/Shield

  1. #1

    A few questions before buying the Teensy Audio Adaptor Board/Shield

    As detailed in this post:

    https://forum.pjrc.com/threads/30628...ugh-Teensy-3-1

    I'm in the process of building a PKE meter replica from Ghostbusters. I have the lights and servos working pretty well, but I've decided at the eleventh hour to add sound effects. Given my inexperience I think the most straightforward way for me to do that will be to play snippets of the actual sound effect using the Teensy Audio Adaptor Board. I've pulled usable clean snippets of the sound effect from various online sources. Perhaps at some point I'll work on synthesizing the sound effect from scratch.

    A few questions:

    I'm only going to need a few snippets of audio clips to do what I want to do. A 32GB micro SD card seems like overkill. Can the 128 MB W25Q128FVSIG flash memory chip take the place of that card, or does it have to be used in conjunction with the card reader? If the card reader isn't required how does one transfer the audio files to that flash chip?

    I don't suppose this W25Q128FVSIG flash memory chip is sold locally anywhere? I'm not seeing it listed at the PJRC store.

    Do I power the Audio Adapter from the 3.3v output of the Teensy (probably a Teensy 3.2)?

    I see that the board says "Do not short VGND to GND." What is VGND?

    If I used this Sparkfun Mono Amplifier:

    https://www.sparkfun.com/products/11044

    would I power that from my 5V regulated supply (reduced from 6v of batteries)? I wouldn't run that from the Teensy 3.3v output, right?

    That Sparkfun Amp has a shutdown pin to save power. I assume it would be a simple matter to trigger a digital output to turn that on and off?

    I think that's it for now. I hope to order this and some other stuff today or tomorrow.

    Thanks.

    Shawn Marshall
    Portland, OR

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Wow, lots of questions. Let's see if I can get them all quickly...

    Quote Originally Posted by WShawn View Post
    Can the 128 MB W25Q128FVSIG flash memory chip take the place of that card,
    Yes, you can play sounds from the W25Q128. Only raw format is supported so far, so you'll have to convert to raw data from whatever format you have.

    or does it have to be used in conjunction with the card reader? If the card reader isn't required how does one transfer the audio files to that flash chip?
    Today the SD card is the only supported way to get your files onto the W25Q128. You first copy them to a SD card, then put the SD card in the audio board and run a program that copies to card to the W25Q128.

    Eventually we'll have software to copy directly from a PC to the W25Q128, but today that code doesn't exist.

    I don't suppose this W25Q128FVSIG flash memory chip is sold locally anywhere? I'm not seeing it listed at the PJRC store.
    You'll probably need to order one from a distributor like Digikey.

    You might be able to talk me into bringing an extra to the DorkbotPDX meetup next Monday (Oct 19th). Monday morning would be a good time to remind me....

    Do I power the Audio Adapter from the 3.3v output of the Teensy (probably a Teensy 3.2)?
    Yup. The audio adaptor is meant to mount above or below the Teensy, where the pins line up.

    I see that the board says "Do not short VGND to GND." What is VGND?
    You probably want to use the line out if you're connecting to that amp board.

    VGND is approx 1.5 volts. Then the two headphone signals vary from 0 to 3V. That's done to eliminate the need for big capacitors to block the DC offset on the 2 signals. But the result is a DC voltage on VGND, which is why you must not short it to GND.

    If I used this Sparkfun Mono Amplifier:

    https://www.sparkfun.com/products/11044
    That looks like a great choice. Connect its two inputs to the line out and the ground pin right next to the line out.

    would I power that from my 5V regulated supply (reduced from 6v of batteries)? I wouldn't run that from the Teensy 3.3v output, right?
    Yup, best to run the amp directly from 5V, or if you use three AA cells, directly from the battery.

    That Sparkfun Amp has a shutdown pin to save power. I assume it would be a simple matter to trigger a digital output to turn that on and off?
    Yup. It should work without this, but it'll drain power when not in use.

    A physical power switch in-line with the battery might be simpler and easier, if you're only building one unit. Software to shut everything down to a very low power mode can be tricky. The concept is simple, but in practice there always seems to be something still draining power, until you spend lots of frustrating time troubleshooting. Then again, automatic power saving is an awesome feature, if you have the time and patience to develop and carefully test it.

  3. #3
    Hi Paul:

    Thanks for taking the time to reply; I'm guessing handholding newbies isn't the most rewarding way to spend one's time. I have a few quick follow-up questions. Before proceeding, though, is there a Wiki or site of some sort that explains the workflow involved in making the Teensy play audio (rather than me posting a ton of questions in forums like this)?

    By raw audio do you mean, like, an uncompressed .wav file? I'm assuming that since that's what your samples are. I'd just need mono.

    If I'm just going to use the SD Micro card to transfer data could I just use whatever's cheapest, like a $9 16GB Samsung card (formatted with FAT-32)?

    Would the above work by itself if I was just playing or looping one .wav track at a time?

    Will playing audio files while driving an LED chaser and a pair of servos overtax a Teensy 3.2?

    I'll let you know on Monday if I'd like one of your flash memory chips. I might be ordering some components from DigiKey anyway, so I could get it from there. (Jason Plumb is my next door neighbor; he introduced me to Arduinos and the Teensy.)

    The prop does have a physical power switch at the base of the handle.

    Thanks again.

    Shawn
    Last edited by WShawn; 10-13-2015 at 08:58 PM.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,680
    Quote Originally Posted by WShawn View Post
    Would the above work by itself if I was just playing or looping one .wav track at a time?

    Will playing audio files while driving an LED chaser and a pair of servos overtax a Teensy 3.2?
    It should work fine.

    For comparison, here's a demo we built for Freescale last year, which controlled 4320 LEDs at 30 Hz and also played 44.1 kHz audio, from a SD card, using only a single Teensy 3.1.

    http://community.arm.com/groups/embe...ker-faire-2014

  5. #5
    Let me check the math. Yes, I think 4320 LEDs is more than 7.

    I ordered a Teensy 3.2, Audio adapter, pot, and headers yesterday. I got a 16GB Samsung EVO micro SD from Best Buy last night for $9. URS has ordered the SparkFun mono amplifier board. The last component I'll need is a small-ish speaker I can fit inside the prop.

    Now, how do I make it all work? Are there any tutorials or quick start guides that would get me down the path of prepping and transferring the audio clips to the SD card and then integrating playback of those clips when called for in my servos/LED chaser sketch?

  6. #6
    Paul:

    I'll be ordering some stuff from Digikey or Mouser in the next few days, so I won't ask you to bring a W25Q128 to the meeting tonight.

    Thanks for the offer.

    Shawn

  7. #7
    Senior Member
    Join Date
    May 2015
    Posts
    386
    Quote Originally Posted by PaulStoffregen View Post
    Wow, lots of questions. Let's see if I can get them all quickly...



    Yes, you can play sounds from the W25Q128. Only raw format is supported so far, so you'll have to convert to raw data from whatever format you have.



    Today the SD card is the only supported way to get your files onto the W25Q128. You first copy them to a SD card, then put the SD card in the audio board and run a program that copies to card to the W25Q128.

    Eventually we'll have software to copy directly from a PC to the W25Q128, but today that code doesn't exist.
    Where is the sketch to do get RAW audio to the W25Q128 from a SD card? I need to read/write 7 small 2 second sound clips to the W25Q128, each are only about 2 seconds long. I see the audio tool has a player, a recorder would be cool but if I can record to a SD then move it that would be a good work around.

  8. #8
    Senior Member
    Join Date
    May 2015
    Posts
    386
    Quote Originally Posted by DaQue View Post
    Where is the sketch to do get RAW audio to the W25Q128 from a SD card? I need to read/write 7 small 2 second sound clips to the W25Q128, each are only about 2 seconds long. I see the audio tool has a player, a recorder would be cool but if I can record to a SD then move it that would be a good work around.
    I found Pauls example sketch to r/w to the sd card here:https://github.com/PaulStoffregen/Au...r/Recorder.ino

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •