123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/modules/minimp3/doc_classes/ResourceImporterMP3.xml.
- .. _class_ResourceImporterMP3:
- ResourceImporterMP3
- ===================
- **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Imports an MP3 audio file for playback.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- MP3 is a lossy audio format, with worse audio quality compared to :ref:`ResourceImporterOggVorbis<class_ResourceImporterOggVorbis>` at a given bitrate.
- In most cases, it's recommended to use Ogg Vorbis over MP3. However, if you're using an MP3 sound source with no higher quality source available, then it's recommended to use the MP3 file directly to avoid double lossy compression.
- MP3 requires more CPU to decode than :ref:`ResourceImporterWAV<class_ResourceImporterWAV>`. If you need to play a lot of simultaneous sounds, it's recommended to use WAV for those sounds instead, especially if targeting low-end devices.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Importing audio samples <../tutorials/assets_pipeline/importing_audio_samples>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------+--------------------------------------------------------------------+-----------+
- | :ref:`int<class_int>` | :ref:`bar_beats<class_ResourceImporterMP3_property_bar_beats>` | ``4`` |
- +---------------------------+--------------------------------------------------------------------+-----------+
- | :ref:`int<class_int>` | :ref:`beat_count<class_ResourceImporterMP3_property_beat_count>` | ``0`` |
- +---------------------------+--------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`bpm<class_ResourceImporterMP3_property_bpm>` | ``0`` |
- +---------------------------+--------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`loop<class_ResourceImporterMP3_property_loop>` | ``false`` |
- +---------------------------+--------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`loop_offset<class_ResourceImporterMP3_property_loop_offset>` | ``0`` |
- +---------------------------+--------------------------------------------------------------------+-----------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_ResourceImporterMP3_property_bar_beats:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **bar_beats** = ``4`` :ref:`🔗<class_ResourceImporterMP3_property_bar_beats>`
- The number of bars within a single beat 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 :ref:`bar_beats<class_ResourceImporterMP3_property_bar_beats>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterMP3_property_beat_count:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **beat_count** = ``0`` :ref:`🔗<class_ResourceImporterMP3_property_beat_count>`
- The beat count of 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 :ref:`beat_count<class_ResourceImporterMP3_property_beat_count>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterMP3_property_bpm:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **bpm** = ``0`` :ref:`🔗<class_ResourceImporterMP3_property_bpm>`
- The beats per minute of the audio track. 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 :ref:`bpm<class_ResourceImporterMP3_property_bpm>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterMP3_property_loop:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **loop** = ``false`` :ref:`🔗<class_ResourceImporterMP3_property_loop>`
- If enabled, the audio will begin playing at the beginning after playback ends by reaching the end of the audio.
- \ **Note:** In :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`, the :ref:`AudioStreamPlayer.finished<class_AudioStreamPlayer_signal_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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterMP3_property_loop_offset:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **loop_offset** = ``0`` :ref:`🔗<class_ResourceImporterMP3_property_loop_offset>`
- Determines where audio will start to loop after playback reaches the end of the audio. This can be used to only loop a part of the audio file, which is useful for some ambient sounds or music. The value is determined in seconds relative to the beginning of the audio. A value of ``0.0`` will loop the entire audio file.
- Only has an effect if :ref:`loop<class_ResourceImporterMP3_property_loop>` is ``true``.
- A more convenient editor for :ref:`loop_offset<class_ResourceImporterMP3_property_loop_offset>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|