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 # include "AUD_C-API.h"
54 #include "BKE_global.h"
56 #include "BKE_sound.h"
57 #include "BKE_library.h"
58 #include "BKE_packedFile.h"
59 #include "BKE_sequencer.h"
60 #include "BKE_scene.h"
64 static int sound_cfra;
67 bSound *BKE_sound_new_file(struct Main *bmain, const char *filename)
76 BLI_strncpy(str, filename, sizeof(str));
78 path = /*bmain ? bmain->name :*/ G.main->name;
80 BLI_path_abs(str, path);
82 len = strlen(filename);
83 while (len > 0 && filename[len - 1] != '/' && filename[len - 1] != '\\')
86 sound = BKE_libblock_alloc(bmain, ID_SO, filename + len);
87 BLI_strncpy(sound->name, filename, FILE_MAX);
88 /* sound->type = SOUND_TYPE_FILE; */ /* XXX unused currently */
90 BKE_sound_load(bmain, sound);
95 void BKE_sound_free(bSound *sound)
97 if (sound->packedfile) {
98 freePackedFile(sound->packedfile);
99 sound->packedfile = NULL;
102 #ifdef WITH_AUDASPACE
104 AUD_unload(sound->handle);
105 sound->handle = NULL;
106 sound->playback_handle = NULL;
110 AUD_unload(sound->cache);
114 BKE_sound_free_waveform(sound);
116 if (sound->spinlock) {
117 BLI_spin_end(sound->spinlock);
118 MEM_freeN(sound->spinlock);
119 sound->spinlock = NULL;
122 #endif /* WITH_AUDASPACE */
125 #ifdef WITH_AUDASPACE
127 static int force_device = -1;
130 static void sound_sync_callback(void *data, int mode, float time)
132 struct Main *bmain = (struct Main *)data;
135 scene = bmain->scene.first;
137 if (scene->audio.flag & AUDIO_SYNC) {
139 BKE_sound_play_scene(scene);
141 BKE_sound_stop_scene(scene);
142 if (scene->playback_handle)
143 AUD_seek(scene->playback_handle, time);
145 scene = scene->id.next;
150 int BKE_sound_define_from_str(const char *str)
152 if (BLI_strcaseeq(str, "NULL"))
153 return AUD_NULL_DEVICE;
154 if (BLI_strcaseeq(str, "SDL"))
155 return AUD_SDL_DEVICE;
156 if (BLI_strcaseeq(str, "OPENAL"))
157 return AUD_OPENAL_DEVICE;
158 if (BLI_strcaseeq(str, "JACK"))
159 return AUD_JACK_DEVICE;
164 void BKE_sound_force_device(int device)
166 force_device = device;
169 void BKE_sound_init_once(void)
172 atexit(BKE_sound_exit_once);
175 void BKE_sound_init(struct Main *bmain)
177 AUD_DeviceSpecs specs;
178 int device, buffersize;
179 const char* device_name;
181 device = U.audiodevice;
182 buffersize = U.mixbufsize;
183 specs.channels = U.audiochannels;
184 specs.format = U.audioformat;
185 specs.rate = U.audiorate;
187 if (force_device >= 0)
188 device = force_device;
195 case AUD_OPENAL_DEVICE:
196 device_name = "OpenAL";
198 case AUD_JACK_DEVICE:
199 device_name = "Jack";
202 device_name = "Null";
206 if (buffersize < 128)
207 buffersize = AUD_DEFAULT_BUFFER_SIZE;
209 if (specs.rate < AUD_RATE_8000)
210 specs.rate = AUD_RATE_44100;
212 if (specs.format <= AUD_FORMAT_INVALID)
213 specs.format = AUD_FORMAT_S16;
215 if (specs.channels <= AUD_CHANNELS_INVALID)
216 specs.channels = AUD_CHANNELS_STEREO;
218 if (!AUD_init(device_name, "Blender", specs, buffersize))
219 AUD_init("Null", "Blender", specs, buffersize);
221 BKE_sound_init_main(bmain);
224 void BKE_sound_init_main(struct Main *bmain)
227 AUD_setSynchronizerCallback(sound_sync_callback, bmain);
229 (void)bmain; /* unused */
233 void BKE_sound_exit(void)
238 void BKE_sound_exit_once(void)
244 /* XXX unused currently */
246 bSound *BKE_sound_new_buffer(struct Main *bmain, bSound *source)
248 bSound *sound = NULL;
250 char name[MAX_ID_NAME + 5];
251 strcpy(name, "buf_");
252 strcpy(name + 4, source->id.name);
254 sound = BKE_libblock_alloc(bmain, ID_SO, name);
256 sound->child_sound = source;
257 sound->type = SOUND_TYPE_BUFFER;
259 sound_load(bmain, sound);
264 bSound *BKE_sound_new_limiter(struct Main *bmain, bSound *source, float start, float end)
266 bSound *sound = NULL;
268 char name[MAX_ID_NAME + 5];
269 strcpy(name, "lim_");
270 strcpy(name + 4, source->id.name);
272 sound = BKE_libblock_alloc(bmain, ID_SO, name);
274 sound->child_sound = source;
275 sound->start = start;
277 sound->type = SOUND_TYPE_LIMITER;
279 sound_load(bmain, sound);
285 void BKE_sound_delete(struct Main *bmain, bSound *sound)
288 BKE_sound_free(sound);
290 BKE_libblock_free(bmain, sound);
294 void BKE_sound_cache(bSound *sound)
296 sound->flags |= SOUND_FLAGS_CACHING;
298 AUD_unload(sound->cache);
300 sound->cache = AUD_bufferSound(sound->handle);
302 sound->playback_handle = sound->cache;
304 sound->playback_handle = sound->handle;
307 void BKE_sound_delete_cache(bSound *sound)
309 sound->flags &= ~SOUND_FLAGS_CACHING;
311 AUD_unload(sound->cache);
313 sound->playback_handle = sound->handle;
317 void BKE_sound_load(struct Main *bmain, bSound *sound)
321 AUD_unload(sound->cache);
326 AUD_unload(sound->handle);
327 sound->handle = NULL;
328 sound->playback_handle = NULL;
331 BKE_sound_free_waveform(sound);
333 /* XXX unused currently */
337 case SOUND_TYPE_FILE:
340 char fullpath[FILE_MAX];
343 PackedFile *pf = sound->packedfile;
345 /* don't modify soundact->sound->name, only change a copy */
346 BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
347 BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
349 /* but we need a packed file then */
351 sound->handle = AUD_loadBuffer((unsigned char *) pf->data, pf->size);
352 /* or else load it from disk */
354 sound->handle = AUD_load(fullpath);
356 /* XXX unused currently */
360 case SOUND_TYPE_BUFFER:
361 if (sound->child_sound && sound->child_sound->handle)
362 sound->handle = AUD_bufferSound(sound->child_sound->handle);
364 case SOUND_TYPE_LIMITER:
365 if (sound->child_sound && sound->child_sound->handle)
366 sound->handle = AUD_limitSound(sound->child_sound, sound->start, sound->end);
370 if (sound->flags & SOUND_FLAGS_MONO) {
371 void *handle = AUD_monoSound(sound->handle);
372 AUD_unload(sound->handle);
373 sound->handle = handle;
376 if (sound->flags & SOUND_FLAGS_CACHING) {
377 sound->cache = AUD_bufferSound(sound->handle);
381 sound->playback_handle = sound->cache;
383 sound->playback_handle = sound->handle;
385 BKE_sound_update_sequencer(bmain, sound);
389 AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume)
391 return AUD_openMixdownDevice(specs, scene->sound_scene, volume, start / FPS);
394 void BKE_sound_create_scene(struct Scene *scene)
396 /* should be done in version patch, but this gets called before */
397 if (scene->r.frs_sec_base == 0)
398 scene->r.frs_sec_base = 1;
400 scene->sound_scene = AUD_createSequencer(FPS, scene->audio.flag & AUDIO_MUTE);
401 AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
402 scene->audio.doppler_factor, scene->audio.distance_model);
403 scene->playback_handle = NULL;
404 scene->sound_scrub_handle = NULL;
405 scene->speaker_handles = NULL;
408 void BKE_sound_destroy_scene(struct Scene *scene)
410 if (scene->playback_handle)
411 AUD_stop(scene->playback_handle);
412 if (scene->sound_scrub_handle)
413 AUD_stop(scene->sound_scrub_handle);
414 if (scene->sound_scene)
415 AUD_destroySequencer(scene->sound_scene);
416 if (scene->speaker_handles)
417 AUD_destroySet(scene->speaker_handles);
420 void BKE_sound_mute_scene(struct Scene *scene, int muted)
422 if (scene->sound_scene)
423 AUD_setSequencerMuted(scene->sound_scene, muted);
426 void BKE_sound_update_fps(struct Scene *scene)
428 if (scene->sound_scene)
429 AUD_setSequencerFPS(scene->sound_scene, FPS);
431 BKE_sequencer_refresh_sound_length(scene);
434 void BKE_sound_update_scene_listener(struct Scene *scene)
436 AUD_updateSequencerData(scene->sound_scene, scene->audio.speed_of_sound,
437 scene->audio.doppler_factor, scene->audio.distance_model);
440 void *BKE_sound_scene_add_scene_sound(struct Scene *scene, struct Sequence *sequence,
441 int startframe, int endframe, int frameskip)
443 if (scene != sequence->scene) {
444 const double fps = FPS;
445 return AUD_addSequence(scene->sound_scene, sequence->scene->sound_scene,
446 startframe / fps, endframe / fps, frameskip / fps);
451 void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
453 return BKE_sound_scene_add_scene_sound(scene, sequence,
454 sequence->startdisp, sequence->enddisp,
455 sequence->startofs + sequence->anim_startofs);
458 void *BKE_sound_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip)
460 const double fps = FPS;
461 void *handle = AUD_addSequence(scene->sound_scene, sequence->sound->playback_handle,
462 startframe / fps, endframe / fps, frameskip / fps);
463 AUD_muteSequence(handle, (sequence->flag & SEQ_MUTE) != 0);
464 AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, CFRA, &sequence->volume, 0);
465 AUD_setSequenceAnimData(handle, AUD_AP_PITCH, CFRA, &sequence->pitch, 0);
466 AUD_setSequenceAnimData(handle, AUD_AP_PANNING, CFRA, &sequence->pan, 0);
470 void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
472 return BKE_sound_add_scene_sound(scene, sequence,
473 sequence->startdisp, sequence->enddisp,
474 sequence->startofs + sequence->anim_startofs);
477 void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle)
479 AUD_removeSequence(scene->sound_scene, handle);
482 void BKE_sound_mute_scene_sound(void *handle, char mute)
484 AUD_muteSequence(handle, mute);
487 void BKE_sound_move_scene_sound(struct Scene *scene, void *handle, int startframe, int endframe, int frameskip)
489 const double fps = FPS;
490 AUD_moveSequence(handle, startframe / fps, endframe / fps, frameskip / fps);
493 void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence)
495 if (sequence->scene_sound) {
496 BKE_sound_move_scene_sound(scene, sequence->scene_sound,
497 sequence->startdisp, sequence->enddisp,
498 sequence->startofs + sequence->anim_startofs);
502 void BKE_sound_update_scene_sound(void *handle, bSound *sound)
504 AUD_updateSequenceSound(handle, sound->playback_handle);
507 void BKE_sound_set_cfra(int cfra)
512 void BKE_sound_set_scene_volume(struct Scene *scene, float volume)
514 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_VOLUME, CFRA, &volume,
515 (scene->audio.flag & AUDIO_VOLUME_ANIMATED) != 0);
518 void BKE_sound_set_scene_sound_volume(void *handle, float volume, char animated)
520 AUD_setSequenceAnimData(handle, AUD_AP_VOLUME, sound_cfra, &volume, animated);
523 void BKE_sound_set_scene_sound_pitch(void *handle, float pitch, char animated)
525 AUD_setSequenceAnimData(handle, AUD_AP_PITCH, sound_cfra, &pitch, animated);
528 void BKE_sound_set_scene_sound_pan(void *handle, float pan, char animated)
530 AUD_setSequenceAnimData(handle, AUD_AP_PANNING, sound_cfra, &pan, animated);
533 void BKE_sound_update_sequencer(struct Main *main, bSound *sound)
537 for (scene = main->scene.first; scene; scene = scene->id.next) {
538 BKE_sequencer_update_sound(scene, sound);
542 static void sound_start_play_scene(struct Scene *scene)
544 if (scene->playback_handle)
545 AUD_stop(scene->playback_handle);
547 AUD_setSequencerDeviceSpecs(scene->sound_scene);
549 if ((scene->playback_handle = AUD_play(scene->sound_scene, 1)))
550 AUD_setLoop(scene->playback_handle, -1);
553 void BKE_sound_play_scene(struct Scene *scene)
556 const float cur_time = (float)((double)CFRA / FPS);
560 status = scene->playback_handle ? AUD_getStatus(scene->playback_handle) : AUD_STATUS_INVALID;
562 if (status == AUD_STATUS_INVALID) {
563 sound_start_play_scene(scene);
565 if (!scene->playback_handle) {
571 if (status != AUD_STATUS_PLAYING) {
572 AUD_seek(scene->playback_handle, cur_time);
573 AUD_resume(scene->playback_handle);
576 if (scene->audio.flag & AUDIO_SYNC)
577 AUD_playSynchronizer();
582 void BKE_sound_stop_scene(struct Scene *scene)
584 if (scene->playback_handle) {
585 AUD_pause(scene->playback_handle);
587 if (scene->audio.flag & AUDIO_SYNC)
588 AUD_stopSynchronizer();
592 void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene)
596 int animation_playing;
598 const float one_frame = (float)(1.0 / FPS);
599 const float cur_time = (float)((double)CFRA / FPS);
603 status = scene->playback_handle ? AUD_getStatus(scene->playback_handle) : AUD_STATUS_INVALID;
605 if (status == AUD_STATUS_INVALID) {
606 sound_start_play_scene(scene);
608 if (!scene->playback_handle) {
613 AUD_pause(scene->playback_handle);
616 animation_playing = 0;
617 for (screen = bmain->screen.first; screen; screen = screen->id.next) {
618 if (screen->animtimer) {
619 animation_playing = 1;
624 if (scene->audio.flag & AUDIO_SCRUB && !animation_playing) {
625 if (scene->audio.flag & AUDIO_SYNC) {
626 AUD_seek(scene->playback_handle, cur_time);
627 AUD_seekSynchronizer(scene->playback_handle, cur_time);
630 AUD_seek(scene->playback_handle, cur_time);
632 AUD_resume(scene->playback_handle);
633 if (scene->sound_scrub_handle && AUD_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID) {
634 AUD_seek(scene->sound_scrub_handle, 0);
637 if (scene->sound_scrub_handle) {
638 AUD_stop(scene->sound_scrub_handle);
640 scene->sound_scrub_handle = AUD_pauseAfter(scene->playback_handle, one_frame);
644 if (scene->audio.flag & AUDIO_SYNC) {
645 AUD_seekSynchronizer(scene->playback_handle, cur_time);
648 if (status == AUD_STATUS_PLAYING) {
649 AUD_seek(scene->playback_handle, cur_time);
657 float BKE_sound_sync_scene(struct Scene *scene)
659 if (scene->playback_handle) {
660 if (scene->audio.flag & AUDIO_SYNC)
661 return AUD_getSynchronizerPosition(scene->playback_handle);
663 return AUD_getPosition(scene->playback_handle);
668 int BKE_sound_scene_playing(struct Scene *scene)
670 if (scene->audio.flag & AUDIO_SYNC)
671 return AUD_isSynchronizerPlaying();
676 void BKE_sound_free_waveform(bSound *sound)
678 SoundWaveform *waveform = sound->waveform;
680 if (waveform->data) {
681 MEM_freeN(waveform->data);
686 sound->waveform = NULL;
689 void BKE_sound_read_waveform(bSound *sound, short *stop)
691 AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
692 SoundWaveform *waveform = MEM_mallocN(sizeof(SoundWaveform), "SoundWaveform");
694 if (info.length > 0) {
695 int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND;
697 waveform->data = MEM_mallocN(length * sizeof(float) * 3, "SoundWaveform.samples");
698 waveform->length = AUD_readSound(sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, stop);
701 /* Create an empty waveform here if the sound couldn't be
702 * read. This indicates that reading the waveform is "done",
703 * whereas just setting sound->waveform to NULL causes other
704 * code to think the waveform still needs to be created. */
705 waveform->data = NULL;
706 waveform->length = 0;
710 if (waveform->data) {
711 MEM_freeN(waveform->data);
714 BLI_spin_lock(sound->spinlock);
715 sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING;
716 BLI_spin_unlock(sound->spinlock);
720 BKE_sound_free_waveform(sound);
722 BLI_spin_lock(sound->spinlock);
723 sound->waveform = waveform;
724 sound->flags &= ~SOUND_FLAGS_WAVEFORM_LOADING;
725 BLI_spin_unlock(sound->spinlock);
728 void BKE_sound_update_scene(Main *bmain, struct Scene *scene)
737 void *new_set = AUD_createSet();
741 /* cheap test to skip looping over all objects (no speakers is a common case) */
742 if (!BLI_listbase_is_empty(&bmain->speaker)) {
743 for (SETLOOPER(scene, sce_it, base)) {
745 if ((ob->type != OB_SPEAKER) || !ob->adt) {
748 for (track = ob->adt->nla_tracks.first; track; track = track->next) {
749 for (strip = track->strips.first; strip; strip = strip->next) {
750 if (strip->type != NLASTRIP_TYPE_SOUND) {
753 speaker = (Speaker *)ob->data;
755 if (AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) {
756 if (speaker->sound) {
757 AUD_moveSequence(strip->speaker_handle, (double)strip->start / FPS, FLT_MAX, 0);
760 AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
761 strip->speaker_handle = NULL;
765 if (speaker->sound) {
766 strip->speaker_handle = AUD_addSequence(scene->sound_scene,
767 speaker->sound->playback_handle,
768 (double)strip->start / FPS, FLT_MAX, 0);
769 AUD_setRelativeSequence(strip->speaker_handle, 0);
773 if (strip->speaker_handle) {
774 const bool mute = ((strip->flag & NLASTRIP_FLAG_MUTED) || (speaker->flag & SPK_MUTED));
775 AUD_addSet(new_set, strip->speaker_handle);
776 AUD_updateSequenceData(strip->speaker_handle, speaker->volume_max,
777 speaker->volume_min, speaker->distance_max,
778 speaker->distance_reference, speaker->attenuation,
779 speaker->cone_angle_outer, speaker->cone_angle_inner,
780 speaker->cone_volume_outer);
782 mat4_to_quat(quat, ob->obmat);
783 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_LOCATION, CFRA, ob->obmat[3], 1);
784 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1);
785 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1);
786 AUD_setSequenceAnimData(strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1);
787 AUD_updateSequenceSound(strip->speaker_handle, speaker->sound->playback_handle);
788 AUD_muteSequence(strip->speaker_handle, mute);
795 while ((handle = AUD_getSet(scene->speaker_handles))) {
796 AUD_removeSequence(scene->sound_scene, handle);
800 mat4_to_quat(quat, scene->camera->obmat);
801 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1);
802 AUD_setSequencerAnimData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1);
805 AUD_destroySet(scene->speaker_handles);
806 scene->speaker_handles = new_set;
809 void *BKE_sound_get_factory(void *sound)
811 return ((bSound *)sound)->playback_handle;
814 /* stupid wrapper because AUD_C-API.h includes Python.h which makesrna doesn't like */
815 float BKE_sound_get_length(bSound *sound)
817 AUD_SoundInfo info = AUD_getInfo(sound->playback_handle);
822 bool BKE_sound_is_jack_supported(void)
824 return (bool)AUD_isJackSupported();
827 #else /* WITH_AUDASPACE */
829 #include "BLI_utildefines.h"
831 int BKE_sound_define_from_str(const char *UNUSED(str)) { return -1; }
832 void BKE_sound_force_device(int UNUSED(device)) {}
833 void BKE_sound_init_once(void) {}
834 void BKE_sound_init(struct Main *UNUSED(bmain)) {}
835 void BKE_sound_exit(void) {}
836 void BKE_sound_exit_once(void) {}
837 void BKE_sound_cache(struct bSound *UNUSED(sound)) {}
838 void BKE_sound_delete_cache(struct bSound *UNUSED(sound)) {}
839 void BKE_sound_load(struct Main *UNUSED(bmain), struct bSound *UNUSED(sound)) {}
840 void BKE_sound_create_scene(struct Scene *UNUSED(scene)) {}
841 void BKE_sound_destroy_scene(struct Scene *UNUSED(scene)) {}
842 void BKE_sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
843 void *BKE_sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence),
844 int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
845 void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *UNUSED(scene),
846 struct Sequence *UNUSED(sequence)) { return NULL; }
847 void *BKE_sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence), int UNUSED(startframe),
848 int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
849 void *BKE_sound_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) { return NULL; }
850 void BKE_sound_remove_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle)) {}
851 void BKE_sound_mute_scene_sound(void *UNUSED(handle), char UNUSED(mute)) {}
852 void BKE_sound_move_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle), int UNUSED(startframe),
853 int UNUSED(endframe), int UNUSED(frameskip)) {}
854 void BKE_sound_move_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) {}
855 void BKE_sound_play_scene(struct Scene *UNUSED(scene)) {}
856 void BKE_sound_stop_scene(struct Scene *UNUSED(scene)) {}
857 void BKE_sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
858 float BKE_sound_sync_scene(struct Scene *UNUSED(scene)) { return NAN_FLT; }
859 int BKE_sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
860 void BKE_sound_read_waveform(struct bSound *sound, short *stop) { UNUSED_VARS(sound, stop); }
861 void BKE_sound_init_main(struct Main *UNUSED(bmain)) {}
862 void BKE_sound_set_cfra(int UNUSED(cfra)) {}
863 void BKE_sound_update_sequencer(struct Main *UNUSED(main), struct bSound *UNUSED(sound)) {}
864 void BKE_sound_update_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
865 void BKE_sound_update_scene_sound(void *UNUSED(handle), struct bSound *UNUSED(sound)) {}
866 void BKE_sound_update_scene_listener(struct Scene *UNUSED(scene)) {}
867 void BKE_sound_update_fps(struct Scene *UNUSED(scene)) {}
868 void BKE_sound_set_scene_sound_volume(void *UNUSED(handle), float UNUSED(volume), char UNUSED(animated)) {}
869 void BKE_sound_set_scene_sound_pan(void *UNUSED(handle), float UNUSED(pan), char UNUSED(animated)) {}
870 void BKE_sound_set_scene_volume(struct Scene *UNUSED(scene), float UNUSED(volume)) {}
871 void BKE_sound_set_scene_sound_pitch(void *UNUSED(handle), float UNUSED(pitch), char UNUSED(animated)) {}
872 float BKE_sound_get_length(struct bSound *UNUSED(sound)) { return 0; }
873 bool BKE_sound_is_jack_supported(void) { return false; }
874 #endif /* WITH_AUDASPACE */