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


Groups > comp.lang.python > #50963 > unrolled thread

Re: Play Ogg Files

Started byDevyn Collier Johnson <devyncjohnson@gmail.com>
First post2013-07-20 08:25 -0400
Last post2013-07-23 06:40 -0400
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Play Ogg Files Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 08:25 -0400
    Re: Play Ogg Files alex23 <wuwei23@gmail.com> - 2013-07-23 10:37 +1000
      Re: Play Ogg Files David Hutto <dwightdhutto@gmail.com> - 2013-07-23 01:19 -0400
      Re: Play Ogg Files Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-23 06:40 -0400

#50963 — Re: Play Ogg Files

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-07-20 08:25 -0400
SubjectRe: Play Ogg Files
Message-ID<mailman.4919.1374323123.3114.python-list@python.org>
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.
>
> Stefan
>
>
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. Plus, I recently learned that Pygame is not Python3 
compatible.

Mahalo,
DCJ

[toc] | [next] | [standalone]


#51063

Fromalex23 <wuwei23@gmail.com>
Date2013-07-23 10:37 +1000
Message-ID<kskirt$4qa$1@dont-email.me>
In reply to#50963
On 20/07/2013 10:25 PM, Devyn Collier Johnson wrote:
> 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. Plus, I recently learned that Pygame is not Python3
> compatible.

Another option would be Pyglet, which uses the cross-platform binary 
AVBin to provide sound support. It may not provide as much control as 
PyAudio, but given your example usage it might be a bit more 
straightforward:

    pyglet.media.load('boot.ogg', streaming=False).play()

http://www.pyglet.org/doc/programming_guide/simple_audio_playback.html

The latest development release provides support for Python 3:

https://code.google.com/p/pyglet/downloads/list?q=1.2alpha1

[toc] | [prev] | [next] | [standalone]


#51069

FromDavid Hutto <dwightdhutto@gmail.com>
Date2013-07-23 01:19 -0400
Message-ID<mailman.4993.1374556762.3114.python-list@python.org>
In reply to#51063

[Multipart message — attachments visible in raw view] — view raw

Devyn, are you just trying to use this in an application? Would a browser
based web app work. I ask because there will still be some sort of DB
interaction, so could it be an option to go with a browser command?


On Mon, Jul 22, 2013 at 8:37 PM, alex23 <wuwei23@gmail.com> wrote:

> On 20/07/2013 10:25 PM, Devyn Collier Johnson wrote:
>
>> 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. Plus, I recently learned that Pygame is not Python3
>> compatible.
>>
>
> Another option would be Pyglet, which uses the cross-platform binary AVBin
> to provide sound support. It may not provide as much control as PyAudio,
> but given your example usage it might be a bit more straightforward:
>
>    pyglet.media.load('boot.ogg', streaming=False).play()
>
> http://www.pyglet.org/doc/**programming_guide/simple_**audio_playback.html<http://www.pyglet.org/doc/programming_guide/simple_audio_playback.html>
>
> The latest development release provides support for Python 3:
>
> https://code.google.com/p/**pyglet/downloads/list?q=1.**2alpha1<https://code.google.com/p/pyglet/downloads/list?q=1.2alpha1>
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>



-- 
Best Regards,
David Hutto
*CEO:* *http://www.hitwebdevelopment.com*

[toc] | [prev] | [next] | [standalone]


#51080

FromDevyn Collier Johnson <devyncjohnson@gmail.com>
Date2013-07-23 06:40 -0400
Message-ID<mailman.5000.1374576026.3114.python-list@python.org>
In reply to#51063

[Multipart message — attachments visible in raw view] — view raw

On 07/23/2013 01:19 AM, David Hutto wrote:
> Devyn, are you just trying to use this in an application? Would a 
> browser based web app work. I ask because there will still be some 
> sort of DB interaction, so could it be an option to go with a browser 
> command?
>
>
> On Mon, Jul 22, 2013 at 8:37 PM, alex23 <wuwei23@gmail.com 
> <mailto:wuwei23@gmail.com>> wrote:
>
>     On 20/07/2013 10:25 PM, Devyn Collier Johnson wrote:
>
>         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. Plus, I recently learned that Pygame is
>         not Python3
>         compatible.
>
>
>     Another option would be Pyglet, which uses the cross-platform
>     binary AVBin to provide sound support. It may not provide as much
>     control as PyAudio, but given your example usage it might be a bit
>     more straightforward:
>
>        pyglet.media.load('boot.ogg', streaming=False).play()
>
>     http://www.pyglet.org/doc/programming_guide/simple_audio_playback.html
>
>     The latest development release provides support for Python 3:
>
>     https://code.google.com/p/pyglet/downloads/list?q=1.2alpha1
>     -- 
>     http://mail.python.org/mailman/listinfo/python-list
>
>
>
>
> -- 
> Best Regards,
> David Hutto
> /*CEO:*/ _http://www.hitwebdevelopment.com_
>
>

I will be playing an ogg file as a bootup sound for a chatbot that runs 
in a terminal. There are no web-applications. I will be looking into the 
different suggestions that I was offered. So far, Pyglet seems to be the 
best. Once I have officially decided and implemented an idea, I will 
share my choice with everyone.

Mahalo,
DCJ

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web