Searching \ for '[PIC]: Sound playback on a PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=sound
Search entire site for: 'Sound playback on a PIC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Sound playback on a PIC'
2004\12\02@163137 by Philip Pemberton

face picon face
Hi,
 Does anyone have any suggestions as to how I might be able to do some form
of sound playback on a PIC?
 I've been looking at raw binary, but binary seems to use a lot of memory
for wave storage. BTc16 (<http://www.romanblack.com>) is OK, but the sound quality
is pretty poor.
 Does anyone have any other suggestions? Bonus points if C or PIC18
assembler source code is available :)

Thanks.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
spam_OUTphilpemTakeThisOuTspamphilpem.me.uk              | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/          | 48xCD, ARCINv6c IDE, SCSI
... Sure, drinking kills brain cells, but only the weak ones.
____________________________________________

2004\12\02@165311 by Jan-Erik Soderholm

face picon face
Philip Pemberton wrote :

> Hi,
> Does anyone have any suggestions as to how I might be able
> to do some form of sound playback on a PIC?
> I've been looking at raw binary, but binary seems to use a
> lot of memory for wave storage. BTc16 (<http://www.romanblack.com>)
> is OK, but the sound quality is pretty poor.
> Does anyone have any other suggestions? Bonus points if C or PIC18
> assembler source code is available :)
>

Hi !
There was a thread about this earlier this fall.
I then pointed to a (PC command line) tool from Olin that takes
a WAV file and produces a PIC assembly file with "data" directives.
The program is called WAV_HAL and I have included the readme file
below together with a (snipped) output. The playback code
should be in the HAL source code. And everything is in the
HAL install kit on Olin's PIC pages.
The code is for a 16F876, but anyway :-)

Best Regards,
Jan-Erik.



                      Program WAV_HAL [options]

Read a WAV file and create the PIC assembler source file for the sound
in the format required by the HAL firmware.  A new WAV file is created
that contains the same information that was written to the PIC
assembler file.  This output WAV file is intended for "previewing" the
sound as it will be stored in the PIC.

Command line options are:

 <input file name>

      The file name must end in ".wav", but this may be omitted on the
      command line.  An input file name must be supplied.

 <output file name>

      Sets the name of the PIC assembler file to produce.  The PIC
      assembler file name will always end in ".aspic", which may be
      omitted on the command line.  The WAV output file will go in the
      same directory as the PIC assembler file, will have the same
      generic name, but will always end in ".wav".

 -FROM s

      Start the output sound at S seconds from the start of the input
      sound.

 -TO s

      End the output sound S seconds from the start of the input
      sound.

 -RRATE m

      Set the relative source stream playback rate.  Values above 1
      cause the source stream to be played back more quickly (more
      samples/second) and values below 1 more slowly.  The default is
      1, which causes the source stream to be played at its intended
      speed.

Example output ("growl.aspic") :

include "hal.inc"

.growl code

growl
global growl

data 5065                   ;number of samples in the sound

data h'2040'
data h'2040'
data h'2040'
data h'2040'
data h'1EC0'
data h'203E'

[sniped aprox 5060 lines...]

data h'1D3D'
data h'1BB9'
data h'1D38'
data h'2040'
data h'2041'

end

____________________________________________

2004\12\02@170642 by Scott Dattalo

face
flavicon
face
On Thu, 2 Dec 2004, Philip Pemberton wrote:

> Hi,
>  Does anyone have any suggestions as to how I might be able to do some form
> of sound playback on a PIC?

I'd suggest WinBond's ISD series chips. The ISD5116, for example, will
provide up to 16 minutes of sound recording and is easily configurable
through a simple I2C interface.

Scott
____________________________________________

2004\12\02@170857 by Wouter van Ooijen

face picon face
> Does anyone have any suggestions as to how I might be able
> to do some form of sound playback on a PIC?

use an external EEPROM?

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


____________________________________________

2004\12\02@171651 by olin_piclist

face picon face
Philip Pemberton wrote:
>   Does anyone have any suggestions as to how I might be able to do
> some form of sound playback on a PIC?

It's nothing fancy and is not compressed, but my HAL project at
http://www.embedinc.com/pic/hal.htm uses sequential 7 bit values stored 2
per 14 bit program memory word of a 16F876.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
____________________________________________

2004\12\02@172353 by Wesley Moore

flavicon
face
Depending on what you're trying to playback ADPCM can save you some  
space. Even better there is an appnote for it:

http://www.microchip.com/stellent/idcplg?
IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011118

Wes

On 03/12/2004, at 8:31 AM, Philip Pemberton wrote:

{Quote hidden}

> ______________________________________________

2004\12\02@184623 by Bob Axtell

face picon face
I've done some research in this area. I found it very interesting.

The RomanBlack approach uses a  single bit change per interval. I've
done a small
amount of research that indicates (to me) that a minimum of 3 bits /
interval is required
to obtain a reasonable result.  1 bit for direction, two bits for delta
amplitude.

You'll need to capture the data with a normal sound file, then process
that file into
a 3-bit format. Looks like 5000 samples/sec would work OK. A 3-bit
format would allow
2 14-bit program words to recover 9 samples. That would mean that a
1-sec message
or song would use 5000/9 or 556 PGM locations. The output is Two (2)
Tri-State pins,
each with a series resistor to a common cap, which drives an AC-coupled
sound amplifier.

I'd designed a F88 card to perform 3-bit capture and reproduction, but
nobody else was
interested in helping me obtain the minimum PCB costs (2-PCB minimum,
about $80 USD).

--Bob

Philip Pemberton wrote:

{Quote hidden}

--
Note: Attachments must be sent to
attachspamKILLspamengineer.cotse.net, and
MAY delay replies to this message.
       520-219-2363

____________________________________________

2004\12\02@185514 by Bob Axtell

face picon face
Oops, I mean 5000/9*2 program words, or 1102 PGM locations, sorry.

--Bob

Bob Axtell wrote:

{Quote hidden}

--
Note: Attachments must be sent to
.....attachKILLspamspam.....engineer.cotse.net, and
MAY delay replies to this message.
       520-219-2363

____________________________________________

2004\12\02@194227 by Philip Pemberton

face picon face
In message <EraseME41AFA949.9030603spam_OUTspamTakeThisOuTcotse.net>
         Bob Axtell <engineerspamspam_OUTcotse.net> wrote:

> I've done some research in this area. I found it very interesting.
>
> The RomanBlack approach uses a  single bit change per interval. I've
> done a small
> amount of research that indicates (to me) that a minimum of 3 bits /
> interval is required
> to obtain a reasonable result.  1 bit for direction, two bits for delta
> amplitude.

I think the main problem with Roman's BTc system is that there's no "keep the
voltage the same" output state and the encoder seems to oscillate too much;
if it hits a voltage that is more than zero-level but less than the
predicted-1 voltage, IYSWIM.

> I'd designed a F88 card to perform 3-bit capture and reproduction, but
> nobody else was
> interested in helping me obtain the minimum PCB costs (2-PCB minimum,
> about $80 USD).

Interesting. Did you ever write any code for it or build up/test the
circuitry on, say, a breadboard?

Later.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
@spam@philpemKILLspamspamphilpem.me.uk              | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/          | 48xCD, ARCINv6c IDE, SCSI
... You can make it foolproof. But you can't make it damn foolproof!
____________________________________________

2004\12\02@204956 by Bob Axtell

face picon face
I've been away from this almost-project. for a few months. Let me see
what I can find.
I know I developed a schematic and a trial PCB layout. It would download
and be controlled
by an RS232 host. Need to find it first.

Actually, I downloaded the schematic onto the PIClist. It would help ME
if I found that schematic
and the email I sent at the same time. I was using a 32Kx8 RAMTRON
scratchpad to store
the output.  Maybe if I searched under my name, Bob Axtell?

--Bob

Philip Pemberton wrote:

{Quote hidden}

--
Note: Attachments must be sent to
spamBeGoneattachspamBeGonespamengineer.cotse.net, and
MAY delay replies to this message.
       520-219-2363

____________________________________________

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...