Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ResourceImporterMP3

Hérite de : ResourceImporter < RefCounted < Object

Importe un fichier audio MP3 pour la lecture.

Description

MP3 est un format audio avec pertes, avec une qualité audio pire que ResourceImporterOggVorbis à un bitrate donné.

Dans la plupart des cas, il est recommandé d'utiliser Ogg Vorbis au lieu de MP3. Cependant, si vous utilisez une source de son MP3 sans source de qualité supérieure disponible, il est recommandé d'utiliser le fichier MP3 directement pour éviter une compression avec double perte.

MP3 nécessite plus de CPU pour le décoder que ResourceImporterWAV. Si vous avez besoin de jouer beaucoup de sons simultanés, il est recommandé d'utiliser le WAV pour ces sons plutôt, surtout si vous ciblez des appareils bas de gamme.

Tutoriels

Propriétés

int

bar_beats

4

int

beat_count

0

float

bpm

0

bool

loop

false

float

loop_offset

0


Descriptions des propriétés

int bar_beats = 4 🔗

The number of beats within a single bar in the audio track. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.

A more convenient editor for bar_beats is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.


int beat_count = 0 🔗

The length of the audio track, in beats. The actual duration of the audio file might be longer than what is indicated by this property. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.

A more convenient editor for beat_count is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.


float bpm = 0 🔗

The tempo of the audio track, measured in beats per minute. This should match the BPM measure that was used to compose the track. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.

A more convenient editor for bpm is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.


bool loop = false 🔗

If enabled, the audio will begin playing either from the beginning or from loop_offset, after playback ends by either reaching the end of the audio or reaching the end of the last beat according to the amount specified in beat_count.

Note: In AudioStreamPlayer, the AudioStreamPlayer.finished signal won't be emitted for looping audio when it reaches the end of the audio file, as the audio will keep playing indefinitely.


float loop_offset = 0 🔗

Détermine où l'audio commencera à reboucler après que la lecture atteignela fin de l'audio. Cela peut être utilisé que pour ne faire boucler qu'une partie du fichier audio, ce qui est utile pour certains sons ou musique ambiants. La valeur est déterminée en secondes par rapport au début de l'audio. Une valeur de 0.0 fera boucler l'ensemble du fichier audio.

A seulement un effet si loop vaut true.

Un éditeur plus commode pour loop_offset est fourni dans le dialogue Paramètres d'import avancés, car il vous permet de prévisualiser vos changements sans avoir à réimporter l'audio.