Ok, makes some sense, and now just experimented with the restart argument of the play_blocking() method, running it inside a loop for ten times, and, it then renders like 10 repeat playbacks one after the other quite quickly, whereas, yes, if just use play(), and then use stop() inbetween, you literally only hear sound being played like once, while it still returns the result of 1 for each time.

Think must, for now just experiment with combinations of something like halting/pausing keystroke handling inbetween timeframe of sound playback, if using play_blocking(), or specifically make use of play(), but also keep track of/insert something like a thread pause for keyboard handling there as well.

And, yes, already had bookmarked that page of the python wiki, but haven't gotten around to looking into it in too much detail as of yet...<smile>

One of the other reasons am quite happy with sound_lib thus far is it offers 2D panning, as well as frequency manipulation, for implementing minor effects on sounds as well - for example, another simple example had is where took the sound of a motorbike running sort of flatly, and by playing it in a form of looping mode, when I then changed frequency in an incremental way, it sounded literally like speeding up, etc., as such.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Tim Roberts" <t...@probo.com>
To: "Python-Win32 List" <python-win32@python.org>
Sent: Thursday, February 14, 2013 8:04 PM
Subject: Re: [python-win32] Python sound playback threading control?


Jacob Kruger wrote:
Well, it's currently making use of the sound_lib module - not sure which API
it's using as such -

It's a wrapper around the "BASS" library, which is itself a wrapper
around the lower-level APIs.  The BASS library itself is an abstraction
-- it lets you think in terms of whole files, rather than individual PCM
packets.  As a result, you give up a certain amount of low-level control.

However, you should be able to "pause" and "stop" the streaming.


but am using the stream object's play_blocking()
method, which seems to be meant to interrupt other playbacks,

Not at all!  A blocking function means that it starts the playback, and
then waits until the entire file is played, so that it cannot be
interrupted.  If you want to interrupt things, that's exactly the WRONG
interface.  You should be using "play".


Alternatively, any thoughts on something simple could try using that would offer something similar in terms of just, at least being able to manipulate
playback pitch, at least 2D panning, pausing/stopping on demand, etc.?

You've crossed a number of different domains there.  You have certainly
exited from the realm of "something simple".  sound_lib will help you
manage your streams (play, pause, stop, etc).  Manipulating the pitch
requires that you manipulate the sound files themselves.  You will have
to decode the files by hand, and run an algorithm on the decoded byte
streams.  2D panning requires low-level access to the speaker
configuration, which is yet another domain.

You might start looking here to see if you can find the type of
resources you need.
   http://wiki.python.org/moin/PythonInMusic

--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to