create_audioSample: Render 'sonify' objects to 'audioSample'

Description Usage Arguments Value See Also Examples

Description

These functions provide the ability to render sonifications to a audioSample object from the audio package, and save to a file. print.sonify calls both these functions in succession.

Usage

1
2
3
  create_audioSample(x, play = FALSE)

  play_audioSample(audioSamp)

Arguments

x

A sonify object to be rendered.

...

Other arguments to be passed to the individual rendering option.

play

Logical indicating whether the created audioSample should be played immediately

audioSamp

An audioSample object, already rendered and ready to be played or saved to file.

Value

render.audio returns an audioSample object (from the audio package) of the sonification.

play_audioSample is called for its side effect, to produce the sound. It is just a wrapper for play on Windows and OS X; on Linux systems it creates a temporary file and plays it with an external *.wav file player (see setPlayer).

See Also

save.wave for saving audioSample objects to file; setPlayer for getting and setting the method of actually playing the rendering; and sonify for general details.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- (sonify(iris) + sonaes(time = Petal.Length, pitch = Petal.Width)
+ shape_notes())
## Not run: out <- create_audioSample(x) ##TODO: temporarily not run while I fix checkSonify
## Not run: 
play_audioSample(out)
## This is the same as just printing the object:
x

## But you can also save it to file using the audio package:
save.wave(out, "myfile.wav")

## End(Not run)

playitbyr documentation built on May 2, 2019, 6:08 p.m.