Class: Wiretap::AudioFormat
- Inherits:
-
ClipFormat
- Object
- ClipFormat
- Wiretap::AudioFormat
- Defined in:
- lib/wiretap.rb,
ext/format.cpp
Constant Summary
Constants inherited from ClipFormat
ClipFormat::BITS_PER_PIXEL_TO_BYTES
Instance Attribute Summary
Attributes inherited from ClipFormat
Instance Method Summary collapse
-
#bps ⇒ Object
Get bits per sample in audio clip.
-
#bps=(value) ⇒ Object
Set bits per sample in audio clip.
-
#sample_rate ⇒ Object
Get sample rate of the clip.
-
#sample_rate=(value) ⇒ Object
Set sample rate of the clip.
-
#samples ⇒ Object
Get number of audio samples in audio clip.
-
#samples=(value) ⇒ Object
Set number of samples in audio clip.
- #to_s ⇒ Object
Methods inherited from ClipFormat
#audio?, #bpp, #bpp=, #buffer_size, #buffer_size=, buffer_size_for, #channels, #channels=, #height, #height=, #initialize, #meta, #meta=, #meta_tag, #meta_tag=, #rate, #rate=, #ratio, #ratio=, #scan, #scan=, #tag, #tag=, #width, #width=
Constructor Details
This class inherits a constructor from Wiretap::ClipFormat
Instance Method Details
#bps ⇒ Object
Get bits per sample in audio clip
270 271 272 273 274 |
# File 'ext/format.cpp', line 270
static VALUE wiretap_format_get_bps(VALUE self) {
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
return INT2FIX(format->bitsPerSample());
}
|
#bps=(value) ⇒ Object
Set bits per sample in audio clip
279 280 281 282 283 284 |
# File 'ext/format.cpp', line 279
static VALUE wiretap_format_set_bps(VALUE self, VALUE value) {
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
format->setBitsPerSample(NUM2INT(value));
return self;
}
|
#sample_rate ⇒ Object
Get sample rate of the clip
289 290 291 292 293 |
# File 'ext/format.cpp', line 289
static VALUE wiretap_format_get_sample_rate(VALUE self) {
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
return rb_float_new(double(format->sampleRate()));
}
|
#sample_rate=(value) ⇒ Object
Set sample rate of the clip
298 299 300 301 302 303 |
# File 'ext/format.cpp', line 298
static VALUE wiretap_format_set_sample_rate(VALUE self, VALUE value){
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
format->setSampleRate(float(RFLOAT(value)->value));
return self;
}
|
#samples ⇒ Object
Get number of audio samples in audio clip
251 252 253 254 255 |
# File 'ext/format.cpp', line 251
static VALUE wiretap_format_get_samples(VALUE self) {
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
return INT2FIX(format->numSamples());
}
|
#samples=(value) ⇒ Object
Set number of samples in audio clip
260 261 262 263 264 265 |
# File 'ext/format.cpp', line 260
static VALUE wiretap_format_set_samples(VALUE self, VALUE value) {
WireTapAudioFormat* format;
Data_Get_Struct(self, WireTapAudioFormat, format);
format->setNumSamples(NUM2INT(value));
return self;
}
|
#to_s ⇒ Object
322 323 324 |
# File 'lib/wiretap.rb', line 322 def to_s "#<Wiretap::AudioFormat samples: #{self.samples}, bps: #{self.bps}, sample rate: #{self.sample_rate}>" end |