char *dest = jack_port_get_buffer( self->ports[i], frames );
jack_ringbuffer_read( self->ringbuffers[i], dest, ring_size < jack_size ? ring_size : jack_size );
+ if ( ring_size < jack_size )
+ memset( dest + ring_size, 0, jack_size - ring_size );
}
return error;
mlt_audio_format afmt = mlt_audio_float;
// Set the preferred params of the test card signal
+ double speed = mlt_properties_get_double( MLT_FRAME_PROPERTIES(frame), "_speed" );
int channels = mlt_properties_get_int( properties, "channels" );
int frequency = mlt_properties_get_int( properties, "frequency" );
+ int scrub = mlt_properties_get_int( properties, "scrub_audio" );
int samples = mlt_sample_calculator( mlt_properties_get_double( properties, "fps" ), frequency, self->counter++ );
float *buffer;
init_audio = 0;
}
- if ( init_audio == 0 )
+ if ( init_audio == 0 && ( speed == 1.0 || speed == 0.0 ) )
{
int i;
size_t mlt_size = samples * sizeof(float);
float volume = mlt_properties_get_double( properties, "volume" );
+ if ( !scrub && speed == 0.0 )
+ volume = 0.0;
+
if ( volume != 1.0 )
{
float *p = buffer;
type: integer
minimum: 1
default: 2
+
- identifier: out_1
title: Send L
type: string
+
- identifier: out_2
title: Send R
type: string
+
- identifier: volume
title: Volume
type: float
minimum: 0.0
default: 1.0
+
- identifier: refresh
description: >
Applications should set this to update the video frame when paused.
type: integer
minimum: 0
maximum: 1
+
+ - identifier: audio_off
+ title: Audio off
+ type: integer
+ description: If 1, disable audio output
+ mutable: yes
+ minimum: 0
+ maximum: 1
+ default: 0
+ widget: checkbox
+
+ - identifier: scrub_audio
+ title: Audio scrubbing
+ type: integer
+ description: If enabled, sound is played even when the speed is not normal.
+ mutable: yes
+ minimum: 0
+ maximum: 1
+ default: 0
+ widget: checkbox
// Set the preferred params of the test card signal
int channels = mlt_properties_get_int( properties, "channels" );
int frequency = mlt_properties_get_int( properties, "frequency" );
+ int scrub = mlt_properties_get_int( properties, "scrub_audio" );
static int counter = 0;
int samples = mlt_sample_calculator( mlt_properties_get_double( properties, "fps" ), frequency, counter++ );
int16_t *pcm;
pthread_cond_wait( &audio_cond, &audio_mutex );
if ( running )
{
- if ( mlt_properties_get_double( properties, "_speed" ) == 1 )
+ if ( scrub || mlt_properties_get_double( properties, "_speed" ) == 1 )
memcpy( &audio_buffer[ audio_avail ], pcm, bytes );
else
memset( &audio_buffer[ audio_avail ], 0, bytes );
type: integer
minimum: 0
maximum: 1
+
+ - identifier: scrub_audio
+ title: Audio scrubbing
+ type: integer
+ description: If enabled, sound is played even when the speed is not normal.
+ mutable: yes
+ minimum: 0
+ maximum: 1
+ default: 0
+ widget: checkbox
// Set the preferred params of the test card signal
int channels = mlt_properties_get_int( properties, "channels" );
int frequency = mlt_properties_get_int( properties, "frequency" );
+ int scrub = mlt_properties_get_int( properties, "scrub_audio" );
static int counter = 0;
int samples = mlt_sample_calculator( mlt_properties_get_double( self->properties, "fps" ), frequency, counter++ );
pthread_cond_wait( &self->audio_cond, &self->audio_mutex );
if ( self->running )
{
- if ( mlt_properties_get_double( properties, "_speed" ) == 1 )
+ if ( scrub || mlt_properties_get_double( properties, "_speed" ) == 1 )
memcpy( &self->audio_buffer[ self->audio_avail ], pcm, bytes );
else
memset( &self->audio_buffer[ self->audio_avail ], 0, bytes );
language: en
tags:
- Audio
+description: >
+ Simple DirectMedia Layer audio only output module.
+
+parameters:
+ - identifier: volume
+ title: Volume
+ type: float
+ description: Audio level factor.
+ mutable: yes
+
+ - identifier: audio_off
+ title: Audio off
+ type: integer
+ description: If 1, disable audio output
+ mutable: yes
+ minimum: 0
+ maximum: 1
+ default: 0
+ widget: checkbox
+
+ - identifier: audio_buffer
+ title: Audio buffer
+ type: integer
+ description: Size of the sdl audio buffer.
+ mutable: yes
+ default: 2048
+ minimum: 128
+
+ - identifier: scrub_audio
+ title: Audio scrubbing
+ type: integer
+ description: If enabled, sound is played even when the speed is not normal.
+ mutable: yes
+ minimum: 0
+ maximum: 1
+ default: 0
+ widget: checkbox