You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AudioStreamWAV stores sound samples loaded from WAV files. To play the stored sound, use an [AudioStreamPlayer] (for non-positional audio) or [AudioStreamPlayer2D]/[AudioStreamPlayer3D] (for positional audio). The sound can be looped.
7
+
AudioStreamWAV stores sound samples loaded from WAV or AIFF files. To play the stored sound, use an [AudioStreamPlayer] (for non-positional audio) or [AudioStreamPlayer2D]/[AudioStreamPlayer3D] (for positional audio). The sound can be looped.
8
8
This class can also be used to store dynamically-generated PCM audio data. See also [AudioStreamGenerator] for procedural audio generation.
Imports data from a WAV/AIFF audio file for playback.
5
5
</brief_description>
6
6
<description>
7
-
WAV is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means high numbers of WAV sounds can be played at the same time, even on low-end devices.
8
-
By default, Redot imports WAV files using the lossy Quite OK Audio compression. You may change this by setting the [member compress/mode] property.
7
+
WAV/AIFF is an uncompressed format, which can provide higher quality compared to Ogg Vorbis and MP3. It also has the lowest CPU cost to decode. This means a high number of sounds can be played at the same time, even on low-end devices.
8
+
By default, Redot imports WAV/AIFF files using the lossy Quite OK Audio compression. You may change this by setting the [member compress/mode] property.
- [b]Detect From WAV:[/b] Uses loop information from the WAV metadata.
28
+
- [b]Detect From WAV:[/b] Uses loop information from the WAV metadata (AIFF does not support this).
29
29
- [b]Disabled:[/b] Don't loop audio, even if the metadata indicates the file playback should loop.
30
30
- [b]Forward:[/b] Standard audio looping. Plays the audio forward from the beginning to [member edit/loop_end], then returns to [member edit/loop_begin] and repeats.
31
31
- [b]Ping-Pong:[/b] Plays the audio forward until [member edit/loop_end], then backwards to [member edit/loop_begin], repeating this cycle.
ERR_FAIL_V_MSG(Ref<AudioStreamWAV>(), vformat("Not a WAV file. File should start with 'RIFF', but found '%s', in file of size %d bytes", riff, file->get_length()));
737
+
drwav wav;
738
+
if (!drwav_init_memory_with_metadata(&wav, p_stream_data.ptr(), p_stream_data.size(), DRWAV_WITH_METADATA, nullptr)) {
739
+
ERR_FAIL_V_MSG(Ref<AudioStreamWAV>(), "Audio data is invalid, corrupted or an unsupported format.");
743
740
}
744
741
745
-
/* GET FILESIZE */
746
-
747
-
// The file size in header is 8 bytes less than the actual size.
ERR_FAIL_V_MSG(Ref<AudioStreamWAV>(), vformat("Not a WAV file. Header should contain 'WAVE', but found '%s', in file of size %d bytes", wave, file->get_length()));
764
-
}
765
-
766
-
// Let users override potential loop points from the WAV.
767
-
// We parse the WAV loop points only with "Detect From WAV" (0).
768
751
int import_loop_mode = p_options["edit/loop_mode"];
0 commit comments