Git Product home page Git Product logo

audio-decode's People

Contributors

alexanderwallin avatar dy avatar greenkeeper[bot] avatar jamen avatar misogihagi avatar thecuvii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

audio-decode's Issues

Cannot decode mp3 Buffer

Receiving an MP3 buffer from Google Cloud Text-to-speech API and I cannot seem to be able to play it back.

		console.log("Synthesizing...");
		const [speech] = await this.client.synthesizeSpeech(request);
		console.log("Synthesized: ", speech);

		console.log("Decoding...");
		const audioBuffer = await decode(speech.audioContent);
		console.log(`Decoded: ${audioBuffer}`);

		console.log("Playing...");
		await play(audioBuffer, {
			autoplay: true,
		});

I get this error:

Synthesizing...
Synthesized:  { audioContent: <Buffer ff f3 44 c4 00 00 00 03 48 01 40 00 00 f0 1a 72 01 46 bc 0d 51 20 39 07 bc 63 44 a1 f8 1c 08 20 c3 df e0 6c 10 58 60 80 00 31 8f fc 03 46 18 5c 1b 16 ... > }
Decoding...
(node:4404) UnhandledPromiseRejectionWarning: Error: Cannot detect audio format of buffer

Add stream version

audio-decode/stream should decode input pcm data by chunks, if it is possible, or as a single piece if not.
It is important to make it compatible with other stream-based components.

Ogg?

  • Should clarify in readme that browser version uses WAA decoding, which supports many codecs.
  • Also should add ogg decoder for node

Implement node part

Right now it is just a stub package for browser, using decodeAudioData.
The main and the most important part is make it work in node.

Will m4a format be supported?

Since m4a (audio-only MPEG-4) is a very common format for audio files, it would be a helpful improvement if audio-decode supports m4a.

Convert ogg files to mp3

I would like to convert a voice recorded blob to mp3, does this library provide that? I have gone through the docs and its not quite clear

Hangs on decoding local mp3

const decode = require('audio-decode')

decode(fs.readFileSync('./path/to/song.mp3'))
.then(console.log)
.catch(console.error)

It hangs for me. How to trouble-shoot?

An in-range update of audio-play is breaking the build 🚨

Version 2.2.0 of audio-play just got published.

Branch Build failing 🚨
Dependency audio-play
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As audio-play is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 5 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Using with React?

Is there any chance I can use it in a React project? Can't figure it out how to make it work for a while.

Asynchronize

For now it is mixed if plain buffer is passed

Cannot detect audio format for some mp3 files.

My audio-decode version: 2.1.1
My MP3 file: test.zip
My code:

const fs = require('fs').promises;

async function main(options) {
    const audioDecode = await import('audio-decode');
    const decode = audioDecode.default;
    await audioDecode.decoders.mp3();
    const buffer = fs.readFile('test.mp3');
    const decodedBuffer = await decode(buffer);
}

main().catch(console.error)

I get the following error:

Error: Cannot detect audio format
    at audioDecode (file:///home/fedora/test/node_modules/audio-decode/audio-decode.js:17:19)
    at main (/home/fedora/test/test.js:8:33)

I cannot import into my TypeScript based project

Hi, when adding that repo to my TypeScript based NodeJS server, I get this error:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/audio-decode/audio-decode.js from .../apps/backend/main.js not supported.
Instead change the require of audio-decode.js in .../apps/backend/main.js to a dynamic import() which is available in all CommonJS modules.

I tried all possible ways of importing the module, like this:

import * as decode from 'audio-decode';
import decode from 'audio-decode';
import {decodeAudio} from 'audio-decode';

I always get the same error.

My tsconfig.json looks like this:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "module": "commonjs",
    "types": ["node"],
    "emitDecoratorMetadata": true,
    "target": "es2015"
  },
  "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
  "include": ["src/**/*.ts"]
}

What can I do to use that package?

Change callback notation?

Right now callback is invoked with inconventional args: cb(buffer).
I guess we should pass error as a first argument.

Move to ESM or archive

This package is urgently useless now. If nothing changes in the following year, scrap that.

Decoder requires an unload function

Hi I am using this decoder and it works well overall. I have a minor issue when I change decoding types. If I use different decoder decoder can't work stops working for certain file types. Until I reload the app. I thought unloading the resources but I didn't find this functionality.

Steps to reproduce the issue.
1-) Run decoder.flac() -> To load flac format.
2-) Run decoder.flac(flacFile) -> I decoded a flac file and it worked well
3-) Run decoder.mp3() -> It looks like working and loading mp3
4-) Run decoder.mp3(mp3File) -> Decoder crashes and not working gives this error in console.

Error:
DOMException: Failed to construct 'AudioBuffer': The number of frames provided (0) is less than or equal to the minimum bound (0).

If I only try to step 3 and 4 it successfuly encodes mp3 file.

Thank you for this awesome library.

Supporting error callback in direct.js

It's not documented very well on MDN, but it looks like you can pass a second callback for error handling:

ctx.decodeAudioData(arraybuffer, function(audiobuffer) {
  // success
}, function(error) {
  // error
});

An in-range update of audio-lena is breaking the build 🚨

Version 1.1.3 of audio-lena just got published.

Branch Build failing 🚨
Dependency audio-lena
Current Version 1.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As audio-lena is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 7 commits.

  • f709b66 1.1.3
  • 176a0c7 Remove greenkeeper
  • eb21a39 Explain example better
  • d502bb9 Add spec table
  • efdebef Merge pull request #4 from audiojs/greenkeeper/initial
  • 66b1414 docs(readme): add Greenkeeper badge
  • 7041c5a chore(package): update dependencies

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.