Method: Hallon::ExampleAudioDriver#format=

Defined in:
lib/hallon/audio_driver.rb

#format=(new_format) ⇒ Object

Note:

see Spotify.enum_type(:sampletype).symbols for a list of possible sample types

Sets the current audio format.

This is only ever called from inside the block given to #stream. It should be safe to recreate any existing audio buffers to fit the new audio format, as no frames will be delivered to the audio driver before this call returns.

Parameters:

  • new_format (Hash)

Options Hash (new_format):

  • :rate (Integer)

    sample rate (eg. 44100)

  • :channels (Integer)

    number of audio channels (eg. 2)

  • :type (Symbol)

    sample type (eg. :int16)



68
69
70
# File 'lib/hallon/audio_driver.rb', line 68

def format=(new_format)
  @format = new_format
end