One playing instance of a sound. make_stream creates it and start_playing hands it to the player,
which owns it from then on. Set user_volume_scale, rate_scale, position and the user_flags before
starting it, or any time while it plays.
sound := load_audio_file("jump.wav");
stream := make_stream(*sound);
stream.user_volume_scale = 0.5;
stream.rate_scale = 1.2; // a little higher in pitch
start_playing(stream);This one is only checked to compile, not run.
Fields
- user_data_u64: u64
- user_data_pointer: *void
- manager_id: s64
- entity_id: s64
- sound_name: string
- user_flags: enum u32 { REPEATING :: 0x1; SPATIALIZED :: 0x2; MUSIC :: 0x10; VOICEOVER :: 0x20; IS_FOOTSTEP :: 0x40; DO_NOT_KILL :: 0x80; PAUSED_DUE_TO_MENU :: 0x100; WAS_PAUSED_DUE_TO_MENU :: 0x200; AMBIENT :: 0x400; }
- internal_flags: enum u32 { FIRST_VOLUME_UPDATE :: 0x2; WAITING_FOR_INITIAL_DECODER_PAGES :: 0x4; FADING_OUT :: 0x8; }
- num_channels: s32
- sound_data: *Sound_Data
- decoder: *Cached_Decoder
- category: Sound_Category
- repeat_start_position: s64
- repeat_end_position: s64
- universe_volume_scale: := 1.0
- user_volume_scale: := 1.0
- play_cursor: float64
- silent_samples_at_start_of_play: s64
- marked: := false
- inaudible: := false
- position: Vector3
- orientation: Quaternion
- inner_radius: := 0.5
- outer_radius: := 10.0
- rate_scale: := 1.0
- samples_streamed_since_entity_update: s64
- max_gain: float
- last_plane_dir: Vector2
- debug_display_volume: float
- silent_this_frame: := false
- debug_watch: := false
- current_rate: float
- desired_rate: float
- input_scale_mappings: [MAX_CHANNELS_PER_SOUND] Scale_Mapping
- initial_samples_fetched: s64
- samples_needed_to_start_playing: s64