2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file blender/blenkernel/intern/sound.c
35 #include "MEM_guardedalloc.h"
37 #include "BLI_blenlib.h"
39 #include "BLI_threads.h"
41 #include "DNA_anim_types.h"
42 #include "DNA_object_types.h"
43 #include "DNA_scene_types.h"
44 #include "DNA_sequence_types.h"
45 #include "DNA_packedFile_types.h"
46 #include "DNA_screen_types.h"
47 #include "DNA_sound_types.h"
48 #include "DNA_speaker_types.h"
51 # ifdef WITH_EXTERNAL_AUDASPACE
52 # include <audaspace/AUD_Sound.h>
53 # include <audaspace/AUD_Sequence.h>
54 # include <audaspace/AUD_Handle.h>
55 # include <audaspace/AUD_Special.h>
58 # include "AUD_C-API.h"
62 #include "BKE_global.h"
64 #include "BKE_sound.h"
65 #include "BKE_library.h"
66 #include "BKE_packedFile.h"
67 #include "BKE_sequencer.h"
68 #include "BKE_scene.h"
72 static int sound_cfra;
75 bSound *BKE_sound_new_file(struct Main *bmain, const char *filename)
84 BLI_strncpy(str, filename, sizeof(str));
86 path = /*bmain ? bmain->name :*/ G.main->name;
88 BLI_path_abs(str, path);
90 len = strlen(filename);
91 while (len > 0 && filename[len - 1] != '/' && filename[len - 1] != '\\')
94 sound = BKE_libblock_alloc(bmain, ID_SO, filename + len);
95 BLI_strncpy(sound->name, filename, FILE_MAX);
96 /* sound->type = SOUND_TYPE_FILE; */ /* XXX unused currently */
98 BKE_sound_load(bmain, sound);
103 void BKE_sound_free(bSound *sound)
105 if (sound->packedfile) {
106 freePackedFile(sound->packedfile);
107 sound->packedfile = NULL;
110 #ifdef WITH_AUDASPACE
112 AUD_unload(sound->handle);
113 sound->handle = NULL;
114 sound->playback_handle = NULL;
118 AUD_unload(sound->cache);
122 BKE_sound_free_waveform(sound);
124 if (sound->spinlock) {
125 BLI_spin_end(sound->spinlock);
126 MEM_freeN(sound->spinlock);
127 sound->spinlock = NULL;
130 #endif /* WITH_AUDASPACE */
133 #ifdef WITH_AUDASPACE
135 static int force_device = -1;
138 static void sound_sync_callback(void *data, int mode, float time)
140 struct Main *bmain = (struct Main *)data;
143 scene = bmain->scene.first;
145 if (scene->audio.flag & AUDIO_SYNC) {
147 BKE_sound_play_scene(scene);
149 BKE_sound_stop_scene(scene);
150 if (scene->playback_handle)
151 AUD_seek(scene->playback_handle, time);
153 scene = scene->id.next;
158 int BKE_sound_define_from_str(const char *str)
160 if (BLI_strcaseeq(str, "NULL"))
162 if (BLI_strcaseeq(str, "SDL"))
164 if (BLI_strcaseeq(str, "OPENAL"))
166 if (BLI_strcaseeq(str, "JACK"))
172 void BKE_sound_force_device(int device)
174 force_device = device;
177 void BKE_sound_init_once(void)
180 atexit(BKE_sound_exit_once);
183 void BKE_sound_init(struct Main *bmain)
185 AUD_DeviceSpecs specs;
186 int device, buffersize;
187 const char* device_name;
189 device = U.audiodevice;
190 buffersize = U.mixbufsize;
191 specs.channels = U.audiochannels;
192 specs.format = U.audioformat;
193 specs.rate = U.audiorate;
195 if (force_device >= 0)
196 device = force_device;
204 device_name = "OpenAL";
207 device_name = "Jack";
210 device_name = "Null";
214 if (buffersize < 128)
217 if (specs.rate < AUD_RATE_8000)
218 specs.rate = AUD_RATE_44100;
220 if (specs.format <= AUD_FORMAT_INVALID)
221 specs.format = AUD_FORMAT_S16;
223 if (specs.channels <= AUD_CHANNELS_INVALID)
224 specs.channels = AUD_CHANNELS_STEREO;
226 if (!AUD_init(device_name, "Blender", specs, buffersize))
227 AUD_init("Null", "Blender", specs, buffersize);
229 BKE_sound_init_main(bmain);
232 void BKE_sound_init_main(struct Main *bmain)
235 AUD_setSynchronizerCallback(sound_sync_callback, bmain);
237 (void)bmain; /* unused */
241 void BKE_sound_exit(void)
246 void BKE_sound_exit_once(void)
252 /* XXX unused currently */
254 bSound *BKE_sound_new_buffer(struct Main *bmain, bSound *source)
256 bSound *sound = NULL;
258 char name[MAX_ID_NAME + 5];
259 strcpy(name, "buf_");
260 strcpy(name + 4, source->id.name);
262 sound = BKE_libblock_alloc(bmain, ID_SO, name);
264 sound->child_sound = source;
265 sound->type = SOUND_TYPE_BUFFER;
267 sound_load(bmain, sound);
272 bSound *BKE_sound_new_limiter(struct Main *bmain, bSound *source, float start, float end)
274 bSound *sound = NULL;
276 char name[MAX_ID_NAME + 5];
277 strcpy(name, "lim_");
278 strcpy(name + 4, source->id.name);
280 sound = BKE_libblock_alloc(bmain, ID_SO, name);
282 sound->child_sound = source;
283 sound->start = start;
285 sound->type = SOUND_TYPE_LIMITER;
287 sound_load(bmain, sound);
293 void BKE_sound_delete(struct Main *bmain, bSound *sound)
296 BKE_sound_free(sound);
298 BKE_libblock_free(bmain, sound);
302 void BKE_sound_cache(bSound *sound)
304 sound->flags |= SOUND_FLAGS_CACHING;
306 AUD_unload(sound->cache);
308 sound->cache = AUD_bufferSound(sound->handle);
310 sound->playback_handle = sound->cache;
312 sound->playback_handle = sound->handle;
315 void BKE_sound_delete_cache(bSound *sound)
317 sound->flags &= ~SOUND_FLAGS_CACHING;
319 AUD_unload(sound->cache);
321 sound->playback_handle = sound->handle;
325 void BKE_sound_load(struct Main *bmain, bSound *sound)
329 AUD_unload(sound->cache);
334 AUD_unload(sound->handle);
335 sound->handle = NULL;
336 sound->playback_handle = NULL;
339 BKE_sound_free_waveform(sound);
341 /* XXX unused currently */
345 case SOUND_TYPE_FILE:
348 char fullpath[FILE_MAX];
351 PackedFile *pf = sound->packedfile;
353 /* don't modify soundact->sound->name, only change a copy */
354 BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
355 BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
357 /* but we need a packed file then */
359 sound->handle = AUD_loadBuffer((unsigned char *) pf->data, pf->size);
360 /* or else load it from disk */
362 sound->handle = AUD_load(fullpath);
364 /* XXX unused currently */
368 case SOUND_TYPE_BUFFER:
369 if (sound->child_sound && sound->child_sound->handle)
370 sound->handle = AUD_bufferSound(sound->child_sound->handle);
372 case SOUND_TYPE_LIMITER:
373 if (sound->child_sound && sound->child_sound->handle)
374 sound->handle = AUD_limitSound(sound->child_sound, sound->start, sound->end);
378 if (sound->flags & SOUND_FLAGS_MONO) {
379 void *handle = AUD_monoSound(sound->handle);
380 AUD_unload(sound->handle);
381 sound->handle = handle;
384 if (sound->flags & SOUND_FLAGS_CACHING) {
385 sound->cache = AUD_bufferSound(sound->handle);
389 sound->playback_handle = sound->cache;
391 sound->playback_handle = sound->handle;
393 BKE_sound_update_sequencer(bmain, sound);
397 AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume)
399 return AUD_openMixdownDevice(specs, scene->sound_scene, volume, start / FPS);
402 void BKE_sound_create_scene(struct Scene *scene)
404 /* should be done in version patch, but this gets called before */
405 if (scene->r.frs_sec_base == 0)
406 scene->r.frs_sec_base = 1;
408 scene->sound_scene = AUD_createSequencer(FPS, scene->audio.flag & AUDIO_MUTE);
409 AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
410 scene->audio.doppler_factor, scene->audio.distance_model);
411 scene->playback_handle = NULL;
412 scene->sound_scrub_handle = NULL;
413 scene->speaker_handles = NULL;
416 void BKE_sound_destroy_scene(struct Scene *scene)
418 if (scene->playback_handle)
419 AUD_stop(scene->playback_handle);
420 if (scene->sound_scrub_handle)
421 AUD_stop(scene->sound_scrub_handle);
422 if (scene->sound_scene)
423 AUD_destroySequencer(scene->sound_scene);
424 if (scene->speaker_handles)
425 AUD_destroySet(scene->speaker_handles);
428 void BKE_sound_mute_scene(struct Scene *scene, int muted)
430 if (scene->sound_scene)
431 AUD_setSequencerMuted(scene->sound_scene, muted);
434 void BKE_sound_update_fps(struct Scene *scene)
436 if (scene->sound_scene)
437 AUD_setSequencerFPS(scene->sound_scene, FPS);
439 BKE_sequencer_refresh_sound_length(scene);
442 void BKE_sound_update_scene_listener(struct Scene *scene)
444 AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
445 scene->audio.doppler_factor, scene->audio.distance_model);
448 void *BKE_sound_scene_add_scene_sound(struct Scene *scene, struct Sequence *sequence,
449 int startframe, int endframe, int frameskip)
451 if (scene != sequence->scene) {
452 const double fps = FPS;
453 return AUD_addSequence(scene->sound_scene, sequence->scene->sound_scene,
454 startframe / fps, endframe / fps, frameskip / fps);
459 void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
461 return BKE_sound_scene_add_scene_sound(scene, sequence,
462 sequence->startdisp, sequence->enddisp,
463 sequence->startofs + sequence->anim_startofs);
466 void *BKE_sound_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip)
468 const double fps = FPS;
469 void *handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle,
470 startframe / fps, endframe / fps, frameskip / fps);
471 AUD_muteSequence(handle, (sequence->flag & SEQ_MUTE) != 0);
472 AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0);
473 AUD_setSequenceAnimData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0);
474 AUD_setSequenceAnimData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0);
478 void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
480 return BKE_sound_add_scene_sound(scene, sequence,
481 sequence->startdisp, sequence->enddisp,
482 sequence->startofs + sequence->anim_startofs);
485 void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle)
487 AUD_removeSequence(scene->sound_scene, handle);
490 void BKE_sound_mute_scene_sound(void *handle, char mute)
492 AUD_muteSequence(handle, mute);
495 void BKE_sound_move_scene_sound(struct Scene *scene, void *handle, int startframe, int endframe, int frameskip)
497 const double fps = FPS;
498 AUD_moveSequence(handle, startframe / fps, endframe / fps, frameskip / fps);
501 void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
503 if (sequence->scene_sound) {
504 BKE_sound_move_scene_sound(scene, sequence->scene_sound,
505 sequence->startdisp, sequence->enddisp,
506 sequence->startofs + sequence->anim_startofs);
510 void BKE_sound_update_scene_sound(void *handle, bSound *sound)
512 AUD_updateSequenceSound(handle, sound->playback_handle);
515 void BKE_sound_set_cfra(int cfra)
520 void BKE_sound_set_scene_volume(struct Scene *scene, float volume)
522 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_VOLUME, CFRA, &volume,
523 (scene->audio.flag & AUDIO_VOLUME_ANIMATED) != 0);
526 void BKE_sound_set_scene_sound_volume(void *handle, float volume, char animated)
528 AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, sound_cfra, &volume, animated);
531 void BKE_sound_set_scene_sound_pitch(void *handle, float pitch, char animated)
533 AUD_setSequenceAnimData(handle, AUD_AP_PITCH, sound_cfra, &pitch, animated);
536 void BKE_sound_set_scene_sound_pan(void *handle, float pan, char animated)
538 AUD_setSequenceAnimData(handle, AUD_AP_PANNING, sound_cfra, &pan, animated);
541 void BKE_sound_update_sequencer(struct Main *main, bSound *sound)
545 for (scene = main->scene.first; scene; scene = scene->id.next) {
546 BKE_sequencer_update_sound(scene, sound);
550 static void sound_start_play_scene(struct Scene *scene)
552 if (scene->playback_handle)
553 AUD_stop(scene->playback_handle);
555 AUD_setSequencerDeviceSpecs(scene->sound_scene);
557 if ((scene->playback_handle = AUD_play(scene->sound_scene, 1)))
558 AUD_setLoop(scene->playback_handle, -1);
561 void BKE_sound_play_scene(struct Scene *scene)
564 const float cur_time = (float)((double)CFRA / FPS);
568 status = scene->playback_handle ? AUD_getStatus(scene->playback_handle) : AUD_STATUS_INVALID;
570 if (status == AUD_STATUS_INVALID) {
571 sound_start_play_scene(scene);
573 if (!scene->playback_handle) {
579 if (status != AUD_STATUS_PLAYING) {
580 AUD_seek(scene->playback_handle, cur_time);
581 AUD_resume(scene->playback_handle);
584 if (scene->audio.flag & AUDIO_SYNC)
585 AUD_playSynchronizer();
590 void BKE_sound_stop_scene(struct Scene *scene)
592 if (scene->playback_handle) {
593 AUD_pause(scene->playback_handle);
595 if (scene->audio.flag & AUDIO_SYNC)
596 AUD_stopSynchronizer();
600 void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene)
604 int animation_playing;
606 const float one_frame = (float)(1.0 / FPS);
607 const float cur_time = (float)((double)CFRA / FPS);
611 status = scene->playback_handle ? AUD_getStatus(scene->playback_handle) : AUD_STATUS_INVALID;
613 if (status == AUD_STATUS_INVALID) {
614 sound_start_play_scene(scene);
616 if (!scene->playback_handle) {
621 AUD_pause(scene->playback_handle);
624 animation_playing = 0;
625 for (screen = bmain->screen.first; screen; screen = screen->id.next) {
626 if (screen->animtimer) {
627 animation_playing = 1;
632 if (scene->audio.flag & AUDIO_SCRUB && !animation_playing) {
633 if (scene->audio.flag & AUDIO_SYNC) {
634 AUD_seek(scene->playback_handle, cur_time);
635 AUD_seekSynchronizer(scene->playback_handle, cur_time);
638 AUD_seek(scene->playback_handle, cur_time);
640 AUD_resume(scene->playback_handle);
641 if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID) {
642 AUD_seek(scene->sound_scrub_handle, 0);
645 if (scene->sound_scrub_handle) {
646 AUD_stop(scene->sound_scrub_handle);
648 scene->sound_scrub_handle = AUD_pauseAfter(scene->playback_handle, one_frame);
652 if (scene->audio.flag & AUDIO_SYNC) {
653 AUD_seekSynchronizer(scene->playback_handle, cur_time);
656 if (status == AUD_STATUS_PLAYING) {
657 AUD_seek(scene->playback_handle, cur_time);
665 float BKE_sound_sync_scene(struct Scene *scene)
667 if (scene->playback_handle) {
668 if (scene->audio.flag & AUDIO_SYNC)
669 return AUD_getSynchronizerPosition(scene->playback_handle);
671 return AUD_getPosition(scene->playback_handle);
676 int BKE_sound_scene_playing(struct Scene *scene)
678 if (scene->audio.flag & AUDIO_SYNC)
679 return AUD_isSynchronizerPlaying();
684 void BKE_sound_free_waveform(bSound *sound)
686 SoundWaveform *waveform = sound->waveform;
688 if (waveform->data) {
689 MEM_freeN(waveform->data);
694 sound->waveform = NULL;
697 void BKE_sound_read_waveform(bSound *sound, short *stop)
699 AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
700 SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");
702 if (info.length > 0) {
703 int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND;
705 waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples");
706 waveform->length = AUD_readSound(sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, stop);
709 /* Create an empty waveform here if the sound couldn't be
710 * read. This indicates that reading the waveform is "done",
711 * whereas just setting sound->waveform to NULL causes other
712 * code to think the waveform still needs to be created. */
713 waveform->data = NULL;
714 waveform->length = 0;
718 if (waveform->data) {
719 MEM_freeN(waveform->data);
722 BLI_spin_lock(sound->spinlock);
723 sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING;
724 BLI_spin_unlock(sound->spinlock);
728 BKE_sound_free_waveform(sound);
730 BLI_spin_lock(sound->spinlock);
731 sound->waveform = waveform;
732 sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING;
733 BLI_spin_unlock(sound->spinlock);
736 void BKE_sound_update_scene(Main *bmain, struct Scene *scene)
745 void *new_set = AUD_createSet();
749 /* cheap test to skip looping over all objects (no speakers is a common case) */
750 if (!BLI_listbase_is_empty(&bmain->speaker)) {
751 for (SETLOOPER(scene, sce_it, base)) {
753 if ((ob->type != OB_SPEAKER) || !ob->adt) {
756 for (track = ob->adt->nla_tracks.first; track; track = track->next) {
757 for (strip = track->strips.first; strip; strip = strip->next) {
758 if (strip->type != NLASTRIP_TYPE_SOUND) {
761 speaker = (Speaker *)ob->data;
763 if (AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) {
764 if (speaker->sound) {
765 AUD_moveSequence(strip->speaker_handle, (double)strip->start / FPS, FLT_MAX, 0);
768 AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
769 strip->speaker_handle = NULL;
773 if (speaker->sound) {
774 strip->speaker_handle = AUD_addSequence(scene->sound_scene,
775 speaker->sound->playback_handle,
776 (double)strip->start / FPS, FLT_MAX, 0);
777 AUD_setRelativeSequence(strip->speaker_handle, 0);
781 if (strip->speaker_handle) {
782 const bool mute = ((strip->flag & NLASTRIP_FLAG_MUTED) || (speaker->flag & SPK_MUTED));
783 AUD_addSet(new_set, strip->speaker_handle);
784 AUD_updateSequenceData(strip->speaker_handle, speaker->volume_max,
785 speaker->volume_min, speaker->distance_max,
786 speaker->distance_reference, speaker->attenuation,
787 speaker->cone_angle_outer, speaker->cone_angle_inner,
788 speaker->cone_volume_outer);
790 mat4_to_quat(quat, ob->obmat);
791 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_LOCATION, CFRA, ob->obmat[3], 1);
792 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1);
793 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1);
794 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1);
795 AUD_updateSequenceSound(strip->speaker_handle, speaker->sound->playback_handle);
796 AUD_muteSequence(strip->speaker_handle, mute);
803 while ((handle = AUD_getSet(scene->speaker_handles))) {
804 AUD_removeSequence(scene->sound_scene, handle);
808 mat4_to_quat(quat, scene->camera->obmat);
809 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1);
810 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1);
813 AUD_destroySet(scene->speaker_handles);
814 scene->speaker_handles = new_set;
817 void *BKE_sound_get_factory(void *sound)
819 return ((bSound *)sound)->playback_handle;
822 /* stupid wrapper because AUD_C-API.h includes Python.h which makesrna doesn't like */
823 float BKE_sound_get_length(bSound *sound)
825 AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
830 bool BKE_sound_is_jack_supported(void)
832 #ifdef WITH_EXTERNAL_AUDASPACE
835 return (bool)AUD_isJackSupported();
839 #else /* WITH_AUDASPACE */
841 #include "BLI_utildefines.h"
843 int BKE_sound_define_from_str(const char *UNUSED(str)) { return -1; }
844 void BKE_sound_force_device(int UNUSED(device)) {}
845 void BKE_sound_init_once(void) {}
846 void BKE_sound_init(struct Main *UNUSED(bmain)) {}
847 void BKE_sound_exit(void) {}
848 void BKE_sound_exit_once(void) {}
849 void BKE_sound_cache(struct bSound *UNUSED(sound)) {}
850 void BKE_sound_delete_cache(struct bSound *UNUSED(sound)) {}
851 void BKE_sound_load(struct Main *UNUSED(bmain), struct bSound *UNUSED(sound)) {}
852 void BKE_sound_create_scene(struct Scene *UNUSED(scene)) {}
853 void BKE_sound_destroy_scene(struct Scene *UNUSED(scene)) {}
854 void BKE_sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
855 void *BKE_sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence),
856 int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
857 void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *UNUSED(scene),
858 struct Sequence *UNUSED(sequence)) { return NULL; }
859 void *BKE_sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence), int UNUSED(startframe),
860 int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
861 void *BKE_sound_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) { return NULL; }
862 void BKE_sound_remove_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle)) {}
863 void BKE_sound_mute_scene_sound(void *UNUSED(handle), char UNUSED(mute)) {}
864 void BKE_sound_move_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle), int UNUSED(startframe),
865 int UNUSED(endframe), int UNUSED(frameskip)) {}
866 void BKE_sound_move_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) {}
867 void BKE_sound_play_scene(struct Scene *UNUSED(scene)) {}
868 void BKE_sound_stop_scene(struct Scene *UNUSED(scene)) {}
869 void BKE_sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
870 float BKE_sound_sync_scene(struct Scene *UNUSED(scene)) { return NAN_FLT; }
871 int BKE_sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
872 void BKE_sound_read_waveform(struct bSound *sound, short *stop) { UNUSED_VARS(sound, stop); }
873 void BKE_sound_init_main(struct Main *UNUSED(bmain)) {}
874 void BKE_sound_set_cfra(int UNUSED(cfra)) {}
875 void BKE_sound_update_sequencer(struct Main *UNUSED(main), struct bSound *UNUSED(sound)) {}
876 void BKE_sound_update_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
877 void BKE_sound_update_scene_sound(void *UNUSED(handle), struct bSound *UNUSED(sound)) {}
878 void BKE_sound_update_scene_listener(struct Scene *UNUSED(scene)) {}
879 void BKE_sound_update_fps(struct Scene *UNUSED(scene)) {}
880 void BKE_sound_set_scene_sound_volume(void *UNUSED(handle), float UNUSED(volume), char UNUSED(animated)) {}
881 void BKE_sound_set_scene_sound_pan(void *UNUSED(handle), float UNUSED(pan), char UNUSED(animated)) {}
882 void BKE_sound_set_scene_volume(struct Scene *UNUSED(scene), float UNUSED(volume)) {}
883 void BKE_sound_set_scene_sound_pitch(void *UNUSED(handle), float UNUSED(pitch), char UNUSED(animated)) {}
884 float BKE_sound_get_length(struct bSound *UNUSED(sound)) { return 0; }
885 bool BKE_sound_is_jack_supported(void) { return false; }
886 #endif /* WITH_AUDASPACE */