+ Reply to Thread
Results 1 to 9 of 9

Thread: SPIN WAV Player

  1. #1

    Default SPIN WAV Player

    Ok, it only plays mono and at a fairly low sample rate of 16 ksps.

    But, for SPIN, I think it's pretty impressive!

    Fairly light on used resources too... (so can be included in other programs...)

    I've included a few samples.

    Files must be PCM WAV mono @ 16000 to play right

    You'll need an SD card installed to use this... (because it plays from the SD card)
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  2. #2

    Default

    Sweet! I'm looking forward to trying this tonight!

    Oldbitcollector

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  3. #3

    Default

    Here's a minimal version without VGA output.

    If you already have Rockiki's SD card object in your project, this code only adds 334 longs...
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  4. #4

    Default

    Here's another sample... About 1 minute clip from Feist's "1234".

    File size at this rate is about 2 MB/minute... So, a 1 GB SD card should hold 8 hours of sound.


    Also, I made a few notes here:
    http://www.rayslogic.com/propeller/P...ng/dac/dac.htm


    Post Edited (Rayman) : 11/9/2007 8:54:41 PM GMT
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  5. #5

    Default

    Just tried it out, works great! A little muddy sounding on my speakers, but I know that's a combination of a lot of different things (mainly really cheap speakers.)

    Looking at your code, I didn't realize doing something like this was just that simple.
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  6. #6

    Default

    Thanks for trying it. As far as quality goes, I used the Demo board and powered speakers and the file sounded (to me) exactly the same as it did when played by my computer. Of course, the fairly low sample rate does reduce the quality a bit.

    Simplicity was the goal with this code. I want to include some sounds in an already bloated project, so it had to be small. Still, there are a few tricks in there that my not be so obvious...
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  7. #7

    Default

    It works great! I just resampled 4 mp3s into 'PCM signed 16bit mono @ 16ksps' and it sounds great! In fact, this sounds better then the music coming from games like Counter-Strike 1.6 / HL1.

    Now I'll have to figure out how to use this (might be a nice thing to put under the Christmas tree or something).

    Harrison

    Post Edited (Harrison.) : 11/10/2007 1:45:17 AM GMT
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  8. #8

    Default

    Works perfectly! File sounds exactly as it did on the PC. I'm getting a couple initial clicks at the
    beginning of the sound file now when I reduced the buffer size, but otherwise perfect!

    Now I've just got to figure out the changes that the Femto version of fsrw has to place this into PropDOS.

    The propeller just blows me away... :)

    Oldbitcollector

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

  9. #9

    Default

    @Rayman:

    Is there any other way I can detect for the end of the wav file? I seem to be loosing it in PropDOS for some reason.

    your current line is: repeat while (j==buffsize*2) 'repeat until end of file

    It looks like the end is never found... Is there an alternative I can set a watchpoint for?

    updated

    Ah ha!

    j > 0 works just fine...


    Thanks
    Oldbit

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.

    Post Edited (Oldbitcollector) : 11/10/2007 6:38:15 AM GMT
    Last edited by ForumTools; 09-30-2010 at 07:19 AM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

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