Re: Playing WAV file with Python



On 03/03/2011 01:32 AM, VGNU Linux wrote:


On Thu, Mar 3, 2011 at 1:54 PM, Chris Rebert <clp2@xxxxxxxxxxxx <mailto:clp2@xxxxxxxxxxxx>> wrote:

On Thu, Mar 3, 2011 at 12:17 AM, VGNU Linux <vgnulinux@xxxxxxxxx
<mailto:vgnulinux@xxxxxxxxx>> wrote:
> On Thu, Mar 3, 2011 at 1:26 PM, Chris Rebert <clp2@xxxxxxxxxxxx
<mailto:clp2@xxxxxxxxxxxx>> wrote:
>> On Tue, Mar 1, 2011 at 11:47 PM, VGNU Linux
<vgnulinux@xxxxxxxxx <mailto:vgnulinux@xxxxxxxxx>> wrote:
>> > How can I play WAV file in python without OS(like
Linux/Windows/MAC) on
>> > a
>> > device ?
>> > On Google I found lot of different solution but related to
OS's like
>> > winsound, ossaudiodev etc which are not useful.
>>
>> Do you mean you want your code to be cross-platform, or what?
>> "Without OS" is rather vague. What are you trying to accomplish?
>
> I will be using WAVE on embedded devices, and the device will
not have any
> OS's. So I am looking for modules which can play WAVE sound without
> underlying OS.

What implementation of Python are you going to use? I don't personally
know of any that can run on the "bare metal" without an OS.


I am planning to use python-on-a-chip(PyMite) which can be run without an OS therefore I am looking for a module/library which can play sound files.


Cheers,
Chris


As you wont be calling the OS via subprocess, which is about the only way to fire up some connect to the sound system, you probably should be talking about the pymite issues on the pymite group over at google about drivers (i.e. sound drivers), what data types (wav, mp3, ogg) they will take and how to pass data to a driver. The

nbed.AnalogOut looks intriguing. Perhaps you can spool a wav file to a port, attach the
analog out to an external amplifier.

http://groups.google.com/group/python-on-a-chip?pli=1

Also, perhaps you should be looking atArduino and audio projects.

http://www.ladyada.net/make/waveshield/




Good luck,

Steven Howe
.



Relevant Pages

  • Background WAV doesnt play
    ... that I wanted to play in the background of my e-mail. ... The sound played flawlessly. ... WAV file without having to re-save the file as an EML file? ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: any port use /dev/dsp directly?
    ... Default sound card for systems with multiple sound cards. ... which works well by opening /dev/dsp, making sure everything is set, the ... other metadata encoded in the wav file format. ... A better way to play wav files would be to install the sox port and use its ...
    (freebsd-questions)
  • RE: Play .wav file at DB start-up
    ... RejectSteelBarCodes - just copy the wav file into this and it should work. ... is that I move that database around and the sound file wont be in the same ... MsgBox "The Sound Did Not Play!" ...
    (microsoft.public.access.gettingstarted)
  • Re: A pps. file in Front Page...no audio!!!
    ... files play at the same time. ... playing more than one sound at a time, ... Is there anyway to have the one wav file play ... >> Steve Rindsberg, PPT MVP ...
    (microsoft.public.powerpoint)
  • Re: Drawing sound
    ... If you want to play specific notes there are several ... Python Midi packages available. ... and sound capabilities. ... > and then being able to play it over the computer speakers. ...
    (comp.lang.python)