Skip to content

TypeError: TypeError: path must be a string or Buffer when calling  #11

Open

Description

@ABettega

I'm having trouble while calling Polly.

Polly.synthesizeSpeech(params, (err, data) => { if (err) { console.log(err.code) } else if (data) { if (data.AudioStream instanceof Buffer) { Fs.writeFile(argv.mp3, data.AudioStream, (err)=> { if (err) { return console.log(err) } console.log("The file was saved!") var output = child_process.execSync('lame --decode ' + argv.mp3 + ' ' + '-b 8000' + ' ' + argv.wav + '.wav'); }) } } })

/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/request.js:31
throw err;
^

TypeError: path must be a string or Buffer
at TypeError (native)
at Object.fs.open (fs.js:631:11)
at Object.fs.writeFile (fs.js:1303:6)
at Response. (/opt/aws-nodejs-sample/script.js:29:4)
at Request. (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/request.js:364:18)
at Request.callListeners (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/opt/aws-nodejs-sample/node_modules/aws-sdk/lib/state_machine.js:14:12)

I have no idea how to fix this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions