Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51012

Re: Play Ogg Files

From Stefan Behnel <stefan_ml@behnel.de>
Subject Re: Play Ogg Files
Date 2013-07-21 16:10 +0200
References <51E9E29E.7010203@Gmail.com> <ksd37r$coj$1@ger.gmane.org> <51EA81A8.9060608@Gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4955.1374415827.3114.python-list@python.org> (permalink)

Show all headers | View raw


Devyn Collier Johnson, 20.07.2013 14:25:
> On 07/20/2013 12:21 AM, Stefan Behnel wrote:
>> Devyn Collier Johnson, 20.07.2013 03:06:
>>> I am making a chatbot that I host on Launchpad.net/neobot. I am currently
>>> converting the engine from BASH code to Python3. I need to convert this for
>>> cross-platform compatibility. I do not need to use Mplayer; I just show the
>>> below code to give others a better idea what I am doing. I would prefer to
>>> be Python3 independent; I do not want to use the system shell. I am fine
>>> with using Python3 modules like Pygame (if there is a py3 module). As long
>>> as the code is fast, efficient, and simple without depending on the system
>>> shell or external apps, that would be nice. I also need the code to execute
>>> while the rest of the script continues running.
>>>
>>>      jobs = multiprocessing.Process(SEND = subprocess.getoutput('mplayer
>>> -nogui -nolirc -noar -quiet ./conf/boot.ogg')) #Boot sound#
>> Well, since you mentioned it already, have you actually looked at pygame?
>> It should be able to do what you want. There's also pyaudio, which is more
>> specialised to, well, audio. A web search for python and ogg might provide
>> more.
>
> Thanks Stefan! I have not heard of Pyaudio; I will look into that. As for
> Pygame, I have not been able to find any good documentation for playing
> audio files.

A quick duckduckgo search gave me this, at least:

http://www.pygame.org/docs/ref/mixer.html


> Plus, I recently learned that Pygame is not Python3 compatible.

Looks like it's your lucky day:

http://www.pygame.org/wiki/FrequentlyAskedQuestions#Does%20Pygame%20work%20with%20Python%203?

Stefan

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Play Ogg Files Stefan Behnel <stefan_ml@behnel.de> - 2013-07-21 16:10 +0200

csiph-web