Microsoft Small Basic


Sound

L'objet Sound offre des fonctionnalités de lecture audio. Quelques exemples de sons sont fournis dans la bibliothèque.

Operations

PlayClick

Sound.PlayClick()

Joue le son clic.

Returns

Nothing

PlayClickAndWait

Sound.PlayClickAndWait()

Joue le son clic et attend la fin pour continuer.

Returns

Nothing

PlayChime

Sound.PlayChime()

Joue le son carillon.

Returns

Nothing

PlayChimeAndWait

Sound.PlayChimeAndWait()

Joue le son carillon et attend la fin pour continuer.

Returns

Nothing

PlayChimes

Sound.PlayChimes()

Joue le son chimes.

Returns

Nothing

PlayChimesAndWait

Sound.PlayChimesAndWait()

Joue le son chimes et attend la fin pour continuer.

Returns

Nothing

PlayBellRing

Sound.PlayBellRing()

Joue le son cloche.

Returns

Nothing

PlayBellRingAndWait

Sound.PlayBellRingAndWait()

Joue le son cloche et attend la fin pour continuer.

Returns

Nothing

PlayMusic

Sound.PlayMusic(notes)

Joue des notes de musique.

notes

Une suite de notes de musique à jouer. Le format est un sous-ensemble du Music Markup Language reconnu par QBasic.

Returns

Nothing

Play

Sound.Play(filePath)

Joue le son clic.

filePath

Returns

Nothing

PlayAndWait

Sound.PlayAndWait(filePath)

Joue un fichier audio et attend qu'il se termine. Cela peut être un fichier MP3, WAV ou WMA. D'autres formats de fichiers peuvent être supportés, cela dépend des codecs audio installés sur l'ordinateur. Si le fichier est déjà en pause, cette opération relance la lecture à partir de la position de la pause.

filePath

Le chemin du fichier audio. Ce peut être un fichier local (ex : c:\musique\chanson1.mp3) ou un fichier sur Internet (ex : http://contoso.com/chanson01.wma).

Returns

Nothing

Pause

Sound.Pause(filePath)

Met en pause le fichier audio. N'a aucun effet si le fichier n'est pas déjà en lecture.

filePath

Le chemin du fichier audio. Ce peut être un fichier local (ex : c:\musique\chanson1.mp3) ou un fichier sur Internet (ex : http://contoso.com/chanson01.wma).

Returns

Nothing

Stop

Sound.Stop(filePath)

Arrête la lecture du fichier audio. N'a aucun effet si le fichier n'est pas déjà en lecture.

filePath

Le chemin du fichier audio. Ce peut être un fichier local (ex : c:\musique\chanson1.mp3) ou un fichier sur Internet (ex : http://contoso.com/chanson01.wma).

Returns

Nothing