mic-recorder-to-mp3
Advanced tools
Comparing version 1.2.3 to 2.0.0
{ | ||
"name": "mic-recorder-to-mp3", | ||
"version": "1.2.3", | ||
"version": "2.0.0", | ||
"description": "Record your microphone audio input and get an audio/mp3 ouput buffer/blob.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -21,3 +21,3 @@ # Microphone Recorder to Mp3 | ||
You can add via CDN using the address: [https://unpkg.com/mic-recorder-to-mp3@1.2.2](https://unpkg.com/mic-recorder-to-mp3@1.2.2). You can find the minified version in the same address, ex: [https://unpkg.com/mic-recorder-to-mp3@1.2.2/dist/index.min.js](https://unpkg.com/mic-recorder-to-mp3@1.2.2/dist/index.min.js) | ||
You can add via CDN using the address: [https://unpkg.com/mic-recorder-to-mp3@1.2.3](https://unpkg.com/mic-recorder-to-mp3@1.2.3). You can find the minified version in the same address, ex: [https://unpkg.com/mic-recorder-to-mp3@1.2.3/dist/index.min.js](https://unpkg.com/mic-recorder-to-mp3@1.2.3/dist/index.min.js) | ||
@@ -51,24 +51,23 @@ **About the version in URL**: Change the URL version to any of our releases. | ||
// Start recording. Browser will request permission to use your microphone. | ||
recorder.start(function () { | ||
console.log('Start recording'); | ||
}, function () { | ||
alert('We could not make use of your microphone at the moment'); | ||
recorder.start().then(() => { | ||
// something else | ||
}).catch((e) => { | ||
console.error(e); | ||
}); | ||
// Once you are done singing your best song, stop and get the mp3. | ||
recorder | ||
.stop() | ||
.getMp3((buffer, blob) => { | ||
// do what ever you want with buffer and blob | ||
// Example: Create a mp3 file and play | ||
const file = new File(buffer, 'me-at-thevoice.mp3', { | ||
type: blob.type, | ||
lastModified: Date.now() | ||
}); | ||
.getMp3().then(([buffer, blob]) => { | ||
// do what ever you want with buffer and blob | ||
// Example: Create a mp3 file and play | ||
const file = new File(buffer, 'me-at-thevoice.mp3', { | ||
type: blob.type, | ||
lastModified: Date.now() | ||
}); | ||
const player = new Audio(URL.createObjectURL(file)); | ||
player.play(); | ||
const player = new Audio(URL.createObjectURL(file)); | ||
player.play(); | ||
}, function (e) { | ||
}).catch((e) => { | ||
alert('We could not retrieve your message'); | ||
@@ -75,0 +74,0 @@ console.log(e); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3272027
18365
89