Ags.Soundcard

g Ags.Soundcard Ags.Soundcard GObject.GInterface GObject.GInterface GObject.GInterface->Ags.Soundcard

Implementations:

None

Methods

class

helper_config_get_buffer_size (config)

class

helper_config_get_cache_buffer_size (config)

class

helper_config_get_dsp_channels (config)

class

helper_config_get_format (config)

class

helper_config_get_pcm_channels (config)

class

helper_config_get_samplerate (config)

class

helper_config_get_use_cache (config)

get_absolute_delay ()

get_attack ()

get_bpm ()

get_buffer ()

get_capability ()

get_delay ()

get_delay_counter ()

get_delay_factor ()

get_device ()

get_loop ()

get_loop_offset ()

get_next_buffer ()

get_note_256th_attack (note_256th_attack_lower, note_256th_attack_upper)

get_note_256th_attack_at_position (note_256th_attack_position)

get_note_256th_attack_of_16th_pulse ()

get_note_256th_attack_of_16th_pulse_position ()

get_note_256th_attack_position (note_256th_attack_position_lower, note_256th_attack_position_upper)

get_note_256th_offset (note_256th_offset_lower, note_256th_offset_upper)

get_note_offset ()

get_note_offset_absolute ()

get_presets ()

get_prev_buffer ()

get_start_note_offset ()

get_sub_block_count ()

get_uptime ()

is_available ()

is_playing ()

is_recording ()

is_starting ()

list_cards ()

lock_buffer (buffer)

offset_changed (note_offset)

pcm_info (card_id)

play ()

play_init ()

record ()

record_init ()

set_bpm (bpm)

set_delay_factor (delay_factor)

set_device (card_id)

set_loop (loop_left, loop_right, do_loop)

set_note_offset (note_offset)

set_note_offset_absolute (note_offset)

set_presets (channels, rate, buffer_size, format)

set_start_note_offset (start_note_offset)

stop ()

tic ()

trylock_sub_block (buffer, sub_block)

unlock_buffer (buffer)

unlock_sub_block (buffer, sub_block)

Virtual Methods

do_get_absolute_delay ()

do_get_attack ()

do_get_bpm ()

do_get_buffer ()

do_get_capability ()

do_get_delay ()

do_get_delay_counter ()

do_get_delay_factor ()

do_get_device ()

do_get_loop ()

do_get_loop_offset ()

do_get_next_buffer ()

do_get_note_256th_attack (note_256th_attack_lower, note_256th_attack_upper)

do_get_note_256th_attack_at_position (note_256th_attack_position)

do_get_note_256th_attack_of_16th_pulse ()

do_get_note_256th_attack_of_16th_pulse_position ()

do_get_note_256th_attack_position (note_256th_attack_position_lower, note_256th_attack_position_upper)

do_get_note_256th_offset (note_256th_offset_lower, note_256th_offset_upper)

do_get_note_offset ()

do_get_note_offset_absolute ()

do_get_presets ()

do_get_prev_buffer ()

do_get_start_note_offset ()

do_get_sub_block_count ()

do_get_uptime ()

do_is_available ()

do_is_playing ()

do_is_recording ()

do_is_starting ()

do_list_cards ()

do_lock_buffer (buffer)

do_offset_changed (note_offset)

do_pcm_info (card_id)

do_play ()

do_play_init ()

do_record ()

do_record_init ()

do_set_bpm (bpm)

do_set_delay_factor (delay_factor)

do_set_device (card_id)

do_set_loop (loop_left, loop_right, do_loop)

do_set_note_offset (note_offset)

do_set_note_offset_absolute (note_offset)

do_set_presets (channels, rate, buffer_size, format)

do_set_start_note_offset (start_note_offset)

do_stop ()

do_tic ()

do_trylock_sub_block (buffer, sub_block)

do_unlock_buffer (buffer)

do_unlock_sub_block (buffer, sub_block)

Properties

None

Signals

Name

Short Description

offset-changed

The ::offset-changed signal notifies about changed position within notation.

stop

The ::stop signal is emitted every stop of the soundcard.

tic

The ::tic signal is emitted every tic of the soundcard.

Fields

None

Class Details

class Ags.Soundcard
Bases:

GObject.GInterface

Structure:

Ags.SoundcardInterface

classmethod helper_config_get_buffer_size(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the buffer size

Return type:

int

Get buffer size.

New in version 3.0.0.

classmethod helper_config_get_cache_buffer_size(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the cache buffer size

Return type:

int

Get cache buffer size.

New in version 6.10.4.

classmethod helper_config_get_dsp_channels(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the count of dsp channels

Return type:

int

Get dsp channels count.

New in version 3.0.0.

classmethod helper_config_get_format(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the format

Return type:

int

Get format as Ags.SoundcardFormat-enum.

New in version 3.0.0.

classmethod helper_config_get_pcm_channels(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the count of pcm channels

Return type:

int

Get pcm channels count.

New in version 3.0.0.

classmethod helper_config_get_samplerate(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

the samplerate

Return type:

float

Get samplerate.

New in version 3.0.0.

classmethod helper_config_get_use_cache(config)
Parameters:

config (Ags.Config) – the Ags.Config

Returns:

if use cache True, otherwise False

Return type:

bool

Get use cache.

New in version 6.10.4.

get_absolute_delay()
Returns:

delay

Return type:

float

Get current playback delay.

New in version 3.0.0.

get_attack()
Returns:

attack

Return type:

int

Get current playback attack.

New in version 3.0.0.

get_bpm()
Returns:

bpm

Return type:

float

Get current playback bpm.

New in version 3.0.0.

get_buffer()
Returns:

current playback buffer

Return type:

object or None

Get current playback buffer.

New in version 3.0.0.

get_capability()
Returns:

the capablities flags

Return type:

Ags.SoundcardCapability

Retrieve Ags.SoundcardCapability-enum information.

New in version 3.0.0.

get_delay()
Returns:

delay

Return type:

float

Get current playback delay.

New in version 3.0.0.

get_delay_counter()
Returns:

offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

get_delay_factor()
Returns:

delay factor

Return type:

float

Get current playback delay factor.

New in version 3.0.0.

get_device()
Returns:

the device’s identifier

Return type:

str

Get device.

New in version 3.0.0.

get_loop()
Returns:

loop_left:

return location of loop position’s region

loop_right:

return location of loop position’s region

do_loop:

return location of do loop

Return type:

(loop_left: int, loop_right: int, do_loop: bool)

Get loop parameters of self.

New in version 3.0.0.

get_loop_offset()
Returns:

offset

Return type:

int

Get current playback loop offset.

New in version 3.0.0.

get_next_buffer()
Returns:

next playback buffer

Return type:

object or None

Get future playback buffer.

New in version 3.0.0.

get_note_256th_attack(note_256th_attack_lower, note_256th_attack_upper)
Parameters:
  • note_256th_attack_lower (int) – the return location of attack lower range

  • note_256th_attack_upper (int) – the return location of attack upper range

Get current playback note 256th attack.

New in version 6.2.2.

get_note_256th_attack_at_position(note_256th_attack_position)
Parameters:

note_256th_attack_position (int) – the note 256th attack position

Return type:

int

Get current playback note 256th attack position within 16 times Ags.SOUNDCARD_DEFAULT_PERIOD.

New in version 6.2.2.

get_note_256th_attack_of_16th_pulse()
Returns:

the note 256th attack of 16th pulse

Return type:

int

Get note 256th attack of current 16th pulse.

New in version 6.3.0.

get_note_256th_attack_of_16th_pulse_position()
Returns:

the note 256th attack position of 16th pulse

Return type:

int

Get note 256th attack position of current 16th pulse.

New in version 6.3.0.

get_note_256th_attack_position(note_256th_attack_position_lower, note_256th_attack_position_upper)
Parameters:
  • note_256th_attack_position_lower (int) – the return location of attack position lower range

  • note_256th_attack_position_upper (int) – the return location of attack position upper range

Get current playback note 256th attack position within 16 times Ags.SOUNDCARD_DEFAULT_PERIOD.

New in version 6.2.2.

get_note_256th_offset(note_256th_offset_lower, note_256th_offset_upper)
Parameters:
  • note_256th_offset_lower (int) – the return location of offset lower range

  • note_256th_offset_upper (int) – the return location of offset upper range

Get current playback note 256th offset.

New in version 6.1.0.

get_note_offset()
Returns:

the current note offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

get_note_offset_absolute()
Returns:

offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

get_presets()
Returns:

channels:

the audio channels

rate:

the samplerate

buffer_size:

the buffer size

format:

the format

Return type:

(channels: int, rate: int, buffer_size: int, format: Ags.SoundcardFormat)

Get presets.

New in version 3.0.0.

get_prev_buffer()
Returns:

prev playback buffer

Return type:

object or None

Get future playback buffer.

New in version 3.0.0.

get_start_note_offset()
Returns:

the start note offset

Return type:

int

Get start playback note offset.

New in version 3.0.0.

get_sub_block_count()
Returns:

the sub block count

Return type:

int

Get sub block count.

New in version 3.0.0.

get_uptime()
Returns:

playback time as string

Return type:

str

Get playback time as string.

New in version 3.0.0.

is_available()
Returns:

True if available, else False

Return type:

bool

Get available.

New in version 3.0.0.

is_playing()
Returns:

True if playing, else False

Return type:

bool

Get playing.

New in version 3.0.0.

is_recording()
Returns:

True if recording, else False

Return type:

bool

Get recording.

New in version 3.0.0.

is_starting()
Returns:

True if starting, else False

Return type:

bool

Get starting.

New in version 3.0.0.

list_cards()
Returns:

card_id:

a list containing card ids

card_name:

a list containing card names

Return type:

(card_id: [str], card_name: [str])

Retrieve card_id and card_name as a list of strings.

New in version 3.0.0.

lock_buffer(buffer)
Parameters:

buffer (object or None) – the buffer to lock

Lock buffer.

New in version 3.0.0.

offset_changed(note_offset)
Parameters:

note_offset (int) – the current note offset

Callback when counter expires minor note offset.

New in version 3.0.0.

pcm_info(card_id)
Parameters:

card_id (str) – the selected soundcard by its string identifier

Raises:

GLib.Error

Returns:

channels_min:

min channels supported

channels_max:

max channels supported

rate_min:

min samplerate supported

rate_max:

max samplerate supported

buffer_size_min:

min buffer size supported by soundcard

buffer_size_max:

max buffer size supported by soundcard

Return type:

(channels_min: int, channels_max: int, rate_min: int, rate_max: int, buffer_size_min: int, buffer_size_max: int)

Retrieve detailed information of card_id soundcard.

New in version 3.0.0.

play()
Raises:

GLib.Error

Plays the current buffer of soundcard.

New in version 3.0.0.

play_init()
Raises:

GLib.Error

Initializes the soundcard for playback.

New in version 3.0.0.

record()
Raises:

GLib.Error

Records the current buffer of soundcard.

New in version 3.0.0.

record_init()
Raises:

GLib.Error

Initializes the soundcard for recordback.

New in version 3.0.0.

set_bpm(bpm)
Parameters:

bpm (float) – the bpm to set

Set current playback bpm.

New in version 3.0.0.

set_delay_factor(delay_factor)
Parameters:

delay_factor (float) – the delay factor to set

Set current playback delay factor.

New in version 3.0.0.

set_device(card_id)
Parameters:

card_id (str) – the device to set

Set device.

New in version 3.0.0.

set_loop(loop_left, loop_right, do_loop)
Parameters:
  • loop_left (int) – loop position of region

  • loop_right (int) – loop position of region

  • do_loop (bool) – if True do loop, else don’t loop

Set loop parameters of self.

New in version 3.0.0.

set_note_offset(note_offset)
Parameters:

note_offset (int) – the note offset to set

Set current playback note offset.

New in version 3.0.0.

set_note_offset_absolute(note_offset)
Parameters:

note_offset (int) – the note offset to set

Set current playback note offset.

New in version 3.0.0.

set_presets(channels, rate, buffer_size, format)
Parameters:
  • channels (int) – the audio channels

  • rate (int) – the samplerate

  • buffer_size (int) – the buffer size

  • format (Ags.SoundcardFormat) – the format

Set presets.

New in version 3.0.0.

set_start_note_offset(start_note_offset)
Parameters:

start_note_offset (int) – the start note offset to set

Set start playback note offset.

New in version 3.0.0.

stop()

Stops the soundcard from playing to it.

New in version 3.0.0.

tic()

Every call to play may generate a tic.

New in version 3.0.0.

trylock_sub_block(buffer, sub_block)
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Returns:

True on success, otherwise False

Return type:

bool

Trylock sub block.

New in version 3.0.0.

unlock_buffer(buffer)
Parameters:

buffer (object or None) – the buffer to unlock

Unlock buffer.

New in version 3.0.0.

unlock_sub_block(buffer, sub_block)
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Unlock sub block.

New in version 3.0.0.

do_get_absolute_delay() virtual
Returns:

delay

Return type:

float

Get current playback delay.

New in version 3.0.0.

do_get_attack() virtual
Returns:

attack

Return type:

int

Get current playback attack.

New in version 3.0.0.

do_get_bpm() virtual
Returns:

bpm

Return type:

float

Get current playback bpm.

New in version 3.0.0.

do_get_buffer() virtual
Returns:

current playback buffer

Return type:

object or None

Get current playback buffer.

New in version 3.0.0.

do_get_capability() virtual
Returns:

the capablities flags

Return type:

Ags.SoundcardCapability

Retrieve Ags.SoundcardCapability-enum information.

New in version 3.0.0.

do_get_delay() virtual
Returns:

delay

Return type:

float

Get current playback delay.

New in version 3.0.0.

do_get_delay_counter() virtual
Returns:

offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

do_get_delay_factor() virtual
Returns:

delay factor

Return type:

float

Get current playback delay factor.

New in version 3.0.0.

do_get_device() virtual
Returns:

the device’s identifier

Return type:

str

Get device.

New in version 3.0.0.

do_get_loop() virtual
Returns:

loop_left:

return location of loop position’s region

loop_right:

return location of loop position’s region

do_loop:

return location of do loop

Return type:

(loop_left: int, loop_right: int, do_loop: bool)

Get loop parameters of soundcard.

New in version 3.0.0.

do_get_loop_offset() virtual
Returns:

offset

Return type:

int

Get current playback loop offset.

New in version 3.0.0.

do_get_next_buffer() virtual
Returns:

next playback buffer

Return type:

object or None

Get future playback buffer.

New in version 3.0.0.

do_get_note_256th_attack(note_256th_attack_lower, note_256th_attack_upper) virtual
Parameters:
  • note_256th_attack_lower (int) – the return location of attack lower range

  • note_256th_attack_upper (int) – the return location of attack upper range

Get current playback note 256th attack.

New in version 6.2.2.

do_get_note_256th_attack_at_position(note_256th_attack_position) virtual
Parameters:

note_256th_attack_position (int) – the note 256th attack position

Return type:

int

Get current playback note 256th attack position within 16 times Ags.SOUNDCARD_DEFAULT_PERIOD.

New in version 6.2.2.

do_get_note_256th_attack_of_16th_pulse() virtual
Returns:

the note 256th attack of 16th pulse

Return type:

int

Get note 256th attack of current 16th pulse.

New in version 6.3.0.

do_get_note_256th_attack_of_16th_pulse_position() virtual
Returns:

the note 256th attack position of 16th pulse

Return type:

int

Get note 256th attack position of current 16th pulse.

New in version 6.3.0.

do_get_note_256th_attack_position(note_256th_attack_position_lower, note_256th_attack_position_upper) virtual
Parameters:
  • note_256th_attack_position_lower (int) – the return location of attack position lower range

  • note_256th_attack_position_upper (int) – the return location of attack position upper range

Get current playback note 256th attack position within 16 times Ags.SOUNDCARD_DEFAULT_PERIOD.

New in version 6.2.2.

do_get_note_256th_offset(note_256th_offset_lower, note_256th_offset_upper) virtual
Parameters:
  • note_256th_offset_lower (int) – the return location of offset lower range

  • note_256th_offset_upper (int) – the return location of offset upper range

Get current playback note 256th offset.

New in version 6.1.0.

do_get_note_offset() virtual
Returns:

the current note offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

do_get_note_offset_absolute() virtual
Returns:

offset

Return type:

int

Get current playback note offset.

New in version 3.0.0.

do_get_presets() virtual
Returns:

channels:

the audio channels

rate:

the samplerate

buffer_size:

the buffer size

format:

the format

Return type:

(channels: int, rate: int, buffer_size: int, format: Ags.SoundcardFormat)

Get presets.

New in version 3.0.0.

do_get_prev_buffer() virtual
Returns:

prev playback buffer

Return type:

object or None

Get future playback buffer.

New in version 3.0.0.

do_get_start_note_offset() virtual
Returns:

the start note offset

Return type:

int

Get start playback note offset.

New in version 3.0.0.

do_get_sub_block_count() virtual
Returns:

the sub block count

Return type:

int

Get sub block count.

New in version 3.0.0.

do_get_uptime() virtual
Returns:

playback time as string

Return type:

str

Get playback time as string.

New in version 3.0.0.

do_is_available() virtual
Returns:

True if available, else False

Return type:

bool

Get available.

New in version 3.0.0.

do_is_playing() virtual
Returns:

True if playing, else False

Return type:

bool

Get playing.

New in version 3.0.0.

do_is_recording() virtual
Returns:

True if recording, else False

Return type:

bool

Get recording.

New in version 3.0.0.

do_is_starting() virtual
Returns:

True if starting, else False

Return type:

bool

Get starting.

New in version 3.0.0.

do_list_cards() virtual
Returns:

card_id:

a list containing card ids

card_name:

a list containing card names

Return type:

(card_id: [str], card_name: [str])

Retrieve card_id and card_name as a list of strings.

New in version 3.0.0.

do_lock_buffer(buffer) virtual
Parameters:

buffer (object or None) – the buffer to lock

Lock buffer.

New in version 3.0.0.

do_offset_changed(note_offset) virtual
Parameters:

note_offset (int) – the current note offset

Callback when counter expires minor note offset.

New in version 3.0.0.

do_pcm_info(card_id) virtual
Parameters:

card_id (str) – the selected soundcard by its string identifier

Returns:

channels_min:

min channels supported

channels_max:

max channels supported

rate_min:

min samplerate supported

rate_max:

max samplerate supported

buffer_size_min:

min buffer size supported by soundcard

buffer_size_max:

max buffer size supported by soundcard

Return type:

(channels_min: int, channels_max: int, rate_min: int, rate_max: int, buffer_size_min: int, buffer_size_max: int)

Retrieve detailed information of card_id soundcard.

New in version 3.0.0.

do_play() virtual

Plays the current buffer of soundcard.

New in version 3.0.0.

do_play_init() virtual

Initializes the soundcard for playback.

New in version 3.0.0.

do_record() virtual

Records the current buffer of soundcard.

New in version 3.0.0.

do_record_init() virtual

Initializes the soundcard for recordback.

New in version 3.0.0.

do_set_bpm(bpm) virtual
Parameters:

bpm (float) – the bpm to set

Set current playback bpm.

New in version 3.0.0.

do_set_delay_factor(delay_factor) virtual
Parameters:

delay_factor (float) – the delay factor to set

Set current playback delay factor.

New in version 3.0.0.

do_set_device(card_id) virtual
Parameters:

card_id (str) – the device to set

Set device.

New in version 3.0.0.

do_set_loop(loop_left, loop_right, do_loop) virtual
Parameters:
  • loop_left (int) – loop position of region

  • loop_right (int) – loop position of region

  • do_loop (bool) – if True do loop, else don’t loop

Set loop parameters of soundcard.

New in version 3.0.0.

do_set_note_offset(note_offset) virtual
Parameters:

note_offset (int) – the note offset to set

Set current playback note offset.

New in version 3.0.0.

do_set_note_offset_absolute(note_offset) virtual
Parameters:

note_offset (int) – the note offset to set

Set current playback note offset.

New in version 3.0.0.

do_set_presets(channels, rate, buffer_size, format) virtual
Parameters:
  • channels (int) – the audio channels

  • rate (int) – the samplerate

  • buffer_size (int) – the buffer size

  • format (Ags.SoundcardFormat) – the format

Set presets.

New in version 3.0.0.

do_set_start_note_offset(start_note_offset) virtual
Parameters:

start_note_offset (int) – the start note offset to set

Set start playback note offset.

New in version 3.0.0.

do_stop() virtual

Stops the soundcard from playing to it.

New in version 3.0.0.

do_tic() virtual

Every call to play may generate a tic.

New in version 3.0.0.

do_trylock_sub_block(buffer, sub_block) virtual
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Returns:

True on success, otherwise False

Return type:

bool

Trylock sub block.

New in version 3.0.0.

do_unlock_buffer(buffer) virtual
Parameters:

buffer (object or None) – the buffer to unlock

Unlock buffer.

New in version 3.0.0.

do_unlock_sub_block(buffer, sub_block) virtual
Parameters:
  • buffer (object or None) – the buffer to lock

  • sub_block (int) – and its sub block

Unlock sub block.

New in version 3.0.0.

Signal Details

Ags.Soundcard.signals.offset_changed(soundcard, note_offset)
Signal Name:

offset-changed

Flags:

RUN_LAST

Parameters:
  • soundcard (Ags.Soundcard) – The object which received the signal

  • note_offset (int) – new notation offset

The ::offset-changed signal notifies about changed position within notation.

New in version 3.0.0.

Ags.Soundcard.signals.stop(soundcard)
Signal Name:

stop

Flags:

RUN_LAST

Parameters:

soundcard (Ags.Soundcard) – The object which received the signal

The ::stop signal is emitted every stop of the soundcard. This notifies about a newly played buffer.

New in version 3.0.0.

Ags.Soundcard.signals.tic(soundcard)
Signal Name:

tic

Flags:

RUN_LAST

Parameters:

soundcard (Ags.Soundcard) – The object which received the signal

The ::tic signal is emitted every tic of the soundcard. This notifies about a newly played buffer.

New in version 3.0.0.