Partilhar via


How do you get a sound for your program?

When you create programs such like games, how do you get sounds for them?

One way is to use preset sounds in Small Basic.  There are four preset sounds as follows.

  1. Bell Ring
  2. Chime
  3. Chimes
  4. Click

Another way is to find free (or public domain) audio files.  You can use Sound.Play() or Sound.PlayAndWait() with audio files.  Mp3, wav, and wma format audio files are supported. Other format depends on audio codecs installed user's computer. 

The other way is to create your own audio files. Following instructions show a sample to create m4a format audio file with Sound Player in Windows 8.1.

  1. Connect a microphone or a instrument to your PC.
     
  2. Start > Apps by category > Tools > Sound Recorder
  3. Click the mic button.
  4. Make a sound.
  5. Click the stop button.
  6. Play the sound.
     
  7. If you need to trim the sound, click Trim button and drag start and end circles then click OK.
  8. And you can find the audio file in following folder. Xxx means your account name.
    C:\Users\xxx\AppData\Local\Packages\Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe\LocalState\Indexed\Recordings 

I made some audio files with CASIO MT-240 keyboard (in the picture above) and uploaded to TechNet Gallery.  And sample code to use these audio files is VTQ526.

See also for your information.

Comments

  • Anonymous
    September 07, 2014
    Some great free resources online are soundrangers.com, soundsnap.com, sfxsource.com, freesound.org. Can be a lot less trouble than trying to record and edit your own and have a really wide variety of sounds to draw from. It's also helpful when recording your own sounds with a microphone to get the ambient noise as quiet as possible, otherwise the recorded sounds won't be pleasant to hear. Also place the microphone as close to the sound source as possible, which also helps cut down the noise.

  • Anonymous
    September 08, 2014
    Kraig, thank you for your information.

  • Anonymous
    September 08, 2014
    This is fantastic! Thanks, Nonki!

  • Anonymous
    September 08, 2014
    I love how Small Basic supports sound like this.

  • Anonymous
    September 10, 2014
    This is great. Thank you.

  • Anonymous
    September 11, 2014
    Ed, Mustafa, thank you for your comments.