3
$\begingroup$

Is it possible to load, manipulate (pitch-shift) and play back a sound without using logic bricks and instead using a script in Blender Game Engine?

Ideally, this would be possible with using only functionality included in Blender on Linux, Mac and Windows.

If this is not possible: what is the minimum required use of the logic bricks for this task?

$\endgroup$
  • $\begingroup$ you want to use a script ? $\endgroup$ – Chebhou May 4 '15 at 0:46
  • $\begingroup$ @Chebhou yes. I updated the question to make that clear. $\endgroup$ – qubodup May 4 '15 at 0:49
2
$\begingroup$

All you need it to load a script file using an Always Sensor and a Python Controller. In the script file put:

import aud
device = aud.device()
sound = aud.Factory.file("sound.ogg")
sound = sound.pitch(2)
device.play(sound)

This will load the file, pitch-shift it and play it back.

blend setup for script-based sound loading, editing and playback

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.