Blender V5.0
BKE_sound.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
9
10#define SOUND_WAVE_SAMPLES_PER_SECOND 250
11
12#if defined(WITH_AUDASPACE)
13# include <AUD_Device.h>
14#endif
15
16struct Depsgraph;
17struct Main;
18struct Strip;
19struct bSound;
20struct SoundInfo;
21
22typedef struct SoundWaveform {
23 int length;
24 float *data;
26
29
30void BKE_sound_init(struct Main *bmain);
31
32void BKE_sound_refresh_callback_bmain(struct Main *bmain);
33
34void BKE_sound_exit();
35
36void BKE_sound_force_device(const char *device);
37
38struct bSound *BKE_sound_new_file(struct Main *bmain, const char *filepath);
39struct bSound *BKE_sound_new_file_exists_ex(struct Main *bmain,
40 const char *filepath,
41 bool *r_exists);
42struct bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepath);
43
44#if 0 /* UNUSED */
45struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
46
47struct bSound *BKE_sound_new_limiter(struct Main *bmain,
48 struct bSound *source,
49 float start,
50 float end);
51#endif
52
53void BKE_sound_cache(struct bSound *sound);
54
55void BKE_sound_delete_cache(struct bSound *sound);
56
57void BKE_sound_reset_runtime(struct bSound *sound);
58void BKE_sound_load(struct Main *bmain, struct bSound *sound);
59void BKE_sound_ensure_loaded(struct Main *bmain, struct bSound *sound);
60
73
74typedef struct SoundInfo {
75 struct {
79 float length;
81
82typedef struct SoundStreamInfo {
83 double duration;
84 double start;
86
92bool BKE_sound_info_get(struct Main *main, struct bSound *sound, SoundInfo *sound_info);
93
100 const char *filepath,
101 int stream,
102 SoundStreamInfo *sound_info);
103
104#if defined(WITH_AUDASPACE)
105AUD_Device *BKE_sound_mixdown(const struct Scene *scene,
106 AUD_DeviceSpecs specs,
107 int start,
108 float volume);
109#endif
110
111void BKE_sound_reset_scene_runtime(struct Scene *scene);
112void BKE_sound_create_scene(struct Scene *scene);
113void BKE_sound_ensure_scene(struct Scene *scene);
114
115void BKE_sound_destroy_scene(struct Scene *scene);
116
117void BKE_sound_lock();
118void BKE_sound_unlock();
119
120void BKE_sound_reset_scene_specs(struct Scene *scene);
121
122void BKE_sound_mute_scene(struct Scene *scene, int muted);
123
124void BKE_sound_update_fps(struct Main *bmain, struct Scene *scene);
125
126void BKE_sound_update_scene_listener(struct Scene *scene);
127
129 struct Scene *scene, struct Strip *sequence, int startframe, int endframe, int frameskip);
130
131void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Strip *sequence);
132
134 struct Scene *scene, struct Strip *sequence, int startframe, int endframe, int frameskip);
135void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Strip *sequence);
136
137void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle);
138
139void BKE_sound_mute_scene_sound(void *handle, bool mute);
140
141void BKE_sound_move_scene_sound(const struct Scene *scene,
142 void *handle,
143 int startframe,
144 int endframe,
145 int frameskip,
146 double audio_offset);
147void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Strip *sequence);
148
150void BKE_sound_update_scene_sound(void *handle, struct bSound *sound);
151
157void BKE_sound_update_sequence_handle(void *handle, void *sound_handle);
158
159void BKE_sound_set_scene_volume(struct Scene *scene, float volume);
160
162 int frame,
163 float volume,
164 char animated);
165
166void BKE_sound_set_scene_sound_pitch_at_frame(void *handle, int frame, float pitch, char animated);
167
169 int frame_start,
170 int frame_end,
171 float pitch);
172
174 int frame,
175 float time_stretch,
176 char animated);
177
179 int frame_start,
180 int frame_end,
181 float time_stretch);
182
183void BKE_sound_set_scene_sound_pan_at_frame(void *handle, int frame, float pan, char animated);
184
185void BKE_sound_update_sequencer(struct Main *main, struct bSound *sound);
186
187void BKE_sound_play_scene(struct Scene *scene);
188
189void BKE_sound_stop_scene(struct Scene *scene);
190
191void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene);
192
193double BKE_sound_sync_scene(struct Scene *scene);
194
195void BKE_sound_free_waveform(struct bSound *sound);
196
197void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, bool *stop);
198
199void BKE_sound_update_scene(struct Depsgraph *depsgraph, struct Scene *scene);
200
201void *BKE_sound_get_factory(void *sound);
202
203float BKE_sound_get_length(struct Main *bmain, struct bSound *sound);
204
206
207typedef void (*SoundJackSyncCallback)(struct Main *bmain, int mode, double time);
208
210void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time);
211
212/* Dependency graph evaluation. */
213
214struct Depsgraph;
215
216void BKE_sound_evaluate(struct Depsgraph *depsgraph, struct Main *bmain, struct bSound *sound);
217
218void *BKE_sound_ensure_time_stretch_effect(void *sound_handle, void *sequence_handle, float fps);
void BKE_sound_set_scene_sound_pan_at_frame(void *handle, int frame, float pan, char animated)
float BKE_sound_get_length(struct Main *bmain, struct bSound *sound)
void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback)
void BKE_sound_create_scene(struct Scene *scene)
void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene)
void BKE_sound_exit()
void * BKE_sound_get_factory(void *sound)
char ** BKE_sound_get_device_names()
void BKE_sound_set_scene_volume(struct Scene *scene, float volume)
void BKE_sound_lock()
double BKE_sound_sync_scene(struct Scene *scene)
bool BKE_sound_info_get(struct Main *main, struct bSound *sound, SoundInfo *sound_info)
void BKE_sound_evaluate(struct Depsgraph *depsgraph, struct Main *bmain, struct bSound *sound)
void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, bool *stop)
void BKE_sound_ensure_loaded(struct Main *bmain, struct bSound *sound)
void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time)
struct bSound * BKE_sound_new_file(struct Main *bmain, const char *filepath)
void(* SoundJackSyncCallback)(struct Main *bmain, int mode, double time)
Definition BKE_sound.h:207
void BKE_sound_reset_scene_specs(struct Scene *scene)
void BKE_sound_mute_scene(struct Scene *scene, int muted)
void BKE_sound_move_scene_sound(const struct Scene *scene, void *handle, int startframe, int endframe, int frameskip, double audio_offset)
void BKE_sound_init(struct Main *bmain)
void BKE_sound_ensure_scene(struct Scene *scene)
void BKE_sound_exit_once()
void BKE_sound_set_scene_sound_time_stretch_constant_range(void *handle, int frame_start, int frame_end, float time_stretch)
void * BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Strip *sequence)
void BKE_sound_refresh_callback_bmain(struct Main *bmain)
void * BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Strip *sequence)
void BKE_sound_reset_scene_runtime(struct Scene *scene)
void BKE_sound_stop_scene(struct Scene *scene)
struct bSound * BKE_sound_new_file_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists)
void BKE_sound_cache(struct bSound *sound)
bool BKE_sound_stream_info_get(struct Main *main, const char *filepath, int stream, SoundStreamInfo *sound_info)
void BKE_sound_set_scene_sound_volume_at_frame(void *handle, int frame, float volume, char animated)
void BKE_sound_update_scene_listener(struct Scene *scene)
void BKE_sound_load(struct Main *bmain, struct bSound *sound)
void BKE_sound_update_scene_sound(void *handle, struct bSound *sound)
void BKE_sound_force_device(const char *device)
void * BKE_sound_add_scene_sound(struct Scene *scene, struct Strip *sequence, int startframe, int endframe, int frameskip)
void BKE_sound_set_scene_sound_pitch_constant_range(void *handle, int frame_start, int frame_end, float pitch)
void BKE_sound_update_sequencer(struct Main *main, struct bSound *sound)
void BKE_sound_init_once()
void BKE_sound_mute_scene_sound(void *handle, bool mute)
struct bSound * BKE_sound_new_file_exists(struct Main *bmain, const char *filepath)
void * BKE_sound_scene_add_scene_sound(struct Scene *scene, struct Strip *sequence, int startframe, int endframe, int frameskip)
void * BKE_sound_ensure_time_stretch_effect(void *sound_handle, void *sequence_handle, float fps)
void BKE_sound_destroy_scene(struct Scene *scene)
void BKE_sound_set_scene_sound_time_stretch_at_frame(void *handle, int frame, float time_stretch, char animated)
void BKE_sound_free_waveform(struct bSound *sound)
void BKE_sound_update_sequence_handle(void *handle, void *sound_handle)
void BKE_sound_reset_runtime(struct bSound *sound)
void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle)
void BKE_sound_set_scene_sound_pitch_at_frame(void *handle, int frame, float pitch, char animated)
void BKE_sound_play_scene(struct Scene *scene)
void BKE_sound_update_scene(struct Depsgraph *depsgraph, struct Scene *scene)
void BKE_sound_delete_cache(struct bSound *sound)
void BKE_sound_update_fps(struct Main *bmain, struct Scene *scene)
void BKE_sound_unlock()
eSoundChannels
Definition BKE_sound.h:62
@ SOUND_CHANNELS_STEREO
Definition BKE_sound.h:65
@ SOUND_CHANNELS_SURROUND5
Definition BKE_sound.h:68
@ SOUND_CHANNELS_SURROUND61
Definition BKE_sound.h:70
@ SOUND_CHANNELS_STEREO_LFE
Definition BKE_sound.h:66
@ SOUND_CHANNELS_SURROUND71
Definition BKE_sound.h:71
@ SOUND_CHANNELS_INVALID
Definition BKE_sound.h:63
@ SOUND_CHANNELS_SURROUND51
Definition BKE_sound.h:69
@ SOUND_CHANNELS_MONO
Definition BKE_sound.h:64
@ SOUND_CHANNELS_SURROUND4
Definition BKE_sound.h:67
void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Strip *sequence)
BPy_StructRNA * depsgraph
#define main()
int samplerate
Definition BKE_sound.h:77
eSoundChannels channels
Definition BKE_sound.h:76
float length
Definition BKE_sound.h:79
struct SoundInfo::@351331251115247062377132230300211145252373324171 specs
double duration
Definition BKE_sound.h:83
float * data
Definition BKE_sound.h:24
char filepath[1024]