Files
BlitzNext/_release/help/commands/2d_commands/SoundPitch.htm
T
2014-12-08 12:43:20 +13:00

52 lines
1.5 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>SoundPitch sound_variable, hertz</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
sound_variable = any valid sound variable previously created with the LoadSound command.
<br />
<br />
hertz = valid playback hertz speed (up to 44000 hertz).
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Alters the pitch of a sound previously loaded with the LoadSound command. By changing the pitch, you can often reuse sounds for different uses or to simulate a 'counting up/down' sound. To make the sound 'higher pitched', increase the hertz. Conversely, decreasing the hertz will 'lower' the pitch. Note: this is in relation to the original hertz frequency of the sound.
</td>
</tr>
</table>
<h1><a href=../2d_examples/SoundPitch.bb>Example</a></h1>
<table>
<tr>
<td>
; Load the sound (11,000 hertz)
<br />
<br />
snd1Up = LoadSound("audiooneup.wav")
<br />
<br />
; Play the sound normally
<br />
PlaySound snd1Up
<br />
<br />
; Change the pitch UP and play it
<br />
SoundPitch snd1Up, 11000*2 ;twice original frequency
<br />
PlaySound snd1Up
<br />
<br />
; Change the pitch down and play it
<br />
SoundPitch snd1Up, 11000/2 ;1/2 original frequency
<br />
PlaySound snd1Up
</td>
</tr>
</table>
<br>
<a target=_top href=../index.htm>Index</a><br>
<br>
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=SoundPitch&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>