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$
2
  • $\begingroup$ you want to use a script ? $\endgroup$
    – Chebhou
    Commented May 4, 2015 at 0:46
  • $\begingroup$ @Chebhou yes. I updated the question to make that clear. $\endgroup$
    – qubodup
    Commented May 4, 2015 at 0:49

1 Answer 1

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$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .