Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Getting a plugin to play sound

Getting a plugin to play sound

From: Joseph Garvin <k04jg02_at_gmail.com>
Date: Sun, 20 Jul 2008 12:53:08 -0400

What's the standard way to get a plugin to play a sound effect? I'm a bit
confused from looking at sources -- some plugins store their sounds in
multiple formats, and wavplay has all sorts of magic constants in it. I have
two problems:

1) How do I convert a wav file into a format that rockbox will be willing to
play? I wrote a python script that will convert any file into an unsigned
short array, but all of my attempts to convert wav->pcm have failed. Maybe
I'm not playing the pcm file correctly? I'm just feeding it into aplay, and
I get random noise. What do people use under linux for playing them?

2) How do I then use rb->pcm_play_data? I guessed that I would just be able
to do something like rb->pcm_play_data(mysound) where mysound is the
unsigned short array, but it wants a function pointer called 'get_more'. Why
is this necessary and what should this function be doing?
Received on 2008-07-20


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa