class_resourceimporteroggvorbis.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/vorbis/doc_classes/ResourceImporterOggVorbis.xml.
  6. .. _class_ResourceImporterOggVorbis:
  7. ResourceImporterOggVorbis
  8. =========================
  9. **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Imports an Ogg Vorbis audio file for playback.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Ogg Vorbis is a lossy audio format, with better audio quality compared to :ref:`ResourceImporterMP3<class_ResourceImporterMP3>` at a given bitrate.
  15. 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.
  16. Ogg Vorbis 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.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Importing audio samples <../tutorials/assets_pipeline/importing_audio_samples>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------+--------------------------------------------------------------------------+-----------+
  27. | :ref:`int<class_int>` | :ref:`bar_beats<class_ResourceImporterOggVorbis_property_bar_beats>` | ``4`` |
  28. +---------------------------+--------------------------------------------------------------------------+-----------+
  29. | :ref:`int<class_int>` | :ref:`beat_count<class_ResourceImporterOggVorbis_property_beat_count>` | ``0`` |
  30. +---------------------------+--------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`bpm<class_ResourceImporterOggVorbis_property_bpm>` | ``0`` |
  32. +---------------------------+--------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`loop<class_ResourceImporterOggVorbis_property_loop>` | ``false`` |
  34. +---------------------------+--------------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`loop_offset<class_ResourceImporterOggVorbis_property_loop_offset>` | ``0`` |
  36. +---------------------------+--------------------------------------------------------------------------+-----------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`AudioStreamOggVorbis<class_AudioStreamOggVorbis>` | :ref:`load_from_buffer<class_ResourceImporterOggVorbis_method_load_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| |
  44. +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`AudioStreamOggVorbis<class_AudioStreamOggVorbis>` | :ref:`load_from_file<class_ResourceImporterOggVorbis_method_load_from_file>`\ (\ path\: :ref:`String<class_String>`\ ) |static| |
  46. +---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Property Descriptions
  51. ---------------------
  52. .. _class_ResourceImporterOggVorbis_property_bar_beats:
  53. .. rst-class:: classref-property
  54. :ref:`int<class_int>` **bar_beats** = ``4`` :ref:`🔗<class_ResourceImporterOggVorbis_property_bar_beats>`
  55. 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.
  56. A more convenient editor for :ref:`bar_beats<class_ResourceImporterOggVorbis_property_bar_beats>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_ResourceImporterOggVorbis_property_beat_count:
  60. .. rst-class:: classref-property
  61. :ref:`int<class_int>` **beat_count** = ``0`` :ref:`🔗<class_ResourceImporterOggVorbis_property_beat_count>`
  62. 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.
  63. A more convenient editor for :ref:`beat_count<class_ResourceImporterOggVorbis_property_beat_count>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_ResourceImporterOggVorbis_property_bpm:
  67. .. rst-class:: classref-property
  68. :ref:`float<class_float>` **bpm** = ``0`` :ref:`🔗<class_ResourceImporterOggVorbis_property_bpm>`
  69. 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.
  70. A more convenient editor for :ref:`bpm<class_ResourceImporterOggVorbis_property_bpm>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_ResourceImporterOggVorbis_property_loop:
  74. .. rst-class:: classref-property
  75. :ref:`bool<class_bool>` **loop** = ``false`` :ref:`🔗<class_ResourceImporterOggVorbis_property_loop>`
  76. If enabled, the audio will begin playing at the beginning after playback ends by reaching the end of the audio.
  77. \ **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.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_ResourceImporterOggVorbis_property_loop_offset:
  81. .. rst-class:: classref-property
  82. :ref:`float<class_float>` **loop_offset** = ``0`` :ref:`🔗<class_ResourceImporterOggVorbis_property_loop_offset>`
  83. 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.
  84. Only has an effect if :ref:`loop<class_ResourceImporterOggVorbis_property_loop>` is ``true``.
  85. A more convenient editor for :ref:`loop_offset<class_ResourceImporterOggVorbis_property_loop_offset>` is provided in the **Advanced Import Settings** dialog, as it lets you preview your changes without having to reimport the audio.
  86. .. rst-class:: classref-section-separator
  87. ----
  88. .. rst-class:: classref-descriptions-group
  89. Method Descriptions
  90. -------------------
  91. .. _class_ResourceImporterOggVorbis_method_load_from_buffer:
  92. .. rst-class:: classref-method
  93. :ref:`AudioStreamOggVorbis<class_AudioStreamOggVorbis>` **load_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| :ref:`🔗<class_ResourceImporterOggVorbis_method_load_from_buffer>`
  94. This method loads audio data from a PackedByteArray buffer into an AudioStreamOggVorbis object.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_ResourceImporterOggVorbis_method_load_from_file:
  98. .. rst-class:: classref-method
  99. :ref:`AudioStreamOggVorbis<class_AudioStreamOggVorbis>` **load_from_file**\ (\ path\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_ResourceImporterOggVorbis_method_load_from_file>`
  100. This method loads audio data from a file into an AudioStreamOggVorbis object. The file path is provided as a string.
  101. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  104. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  105. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  106. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  107. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  108. .. |void| replace:: :abbr:`void (No return value.)`