Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielstorey/WebAudioTrack
This is an easy to use plugin that enables you to record and play back a single track of audio.
https://github.com/danielstorey/WebAudioTrack
Last synced: 9 days ago
JSON representation
This is an easy to use plugin that enables you to record and play back a single track of audio.
- Host: GitHub
- URL: https://github.com/danielstorey/WebAudioTrack
- Owner: danielstorey
- License: mit
- Created: 2018-02-21T16:38:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-30T02:34:54.000Z (over 5 years ago)
- Last Synced: 2024-08-01T13:34:04.414Z (3 months ago)
- Language: JavaScript
- Size: 177 KB
- Stars: 54
- Watchers: 4
- Forks: 18
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Web Audio Track
This is an easy to use plugin that enables you to record and play back a single track of audio. You can also load audio from a url and concatenate audio from recorded sounds and external audio files into a single audio track.
#### [Click here](https://danielstorey.github.io/WebAudioTrack/index.html) for the demo
An audio track can be created like so:
```
var audioTrack = new WebAudioTrack()
```This creates a single track of audio. For more than one track, or source simply construct multiple instances e.g.
```
var microphoneTrack = new WebAudioTrack();
var mp3Track = new WebAudioTrack();
```You can then use the methods below to record and playback audio.
## Properties
### isPlaying
Type: Boolean
### isRecording
Type: Boolean
### volume
Type: Number
## Methods
### play():Promise
Play the audio track.
### stop()
Stop playing the audio track.
### startRecording(callback?:function)
Start recording via the microphone. Takes an optional callback parameter.
If called a second time the previous recording will be overwritten.
### stopRecording(callback?:function)
Stop the recording process. Takes an optional callback parameter.
### getRecordingTime(): number
Returns the length of the recording in seconds
### getBlobSrc(): string
Returns a blob:// URL for the recording
### setVolume(value: number)
Set the playback volume. Value should be in between 0 and 1.
### loadUrl(url: string): Promise
Loads audio data from an external file specified in the url parameter.
### appendAudioFromTrack(WebAudioTrack)
Append audio from another WebAudiotrack instance to the current audio track.
### appendAudioFromUrl(url)
Append audio from an external file to the current audio track.