Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加声音文件时报错 #44

Closed
robinma opened this issue Jun 12, 2021 · 1 comment
Closed

添加声音文件时报错 #44

robinma opened this issue Jun 12, 2021 · 1 comment

Comments

@robinma
Copy link

robinma commented Jun 12, 2021

添加声音mp3文件,当编译时报错,执行代码如下:
`
....
const voicePath = setPath(pathId, "voice.mp3");
...
const vioce_s2 = new FFAudio({ src: voicePath });
scene2.addChild(vioce_s2);

....
scene2.setDuration(5);
creator.addChild(scene2);

`
返回错误信息如下:

(node:4663) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'remove' of undefined
at Layer.appendChild (/Users/mzj/mw/git/video-demo/node_modules/spritejs/dist/spritejs.js:34380:10)
at FFScene.addChild (/Users/mzj/mw/git/video-demo/node_modules/ffcreator/lib/node/cons.js:55:18)
at createFFTask (/Users/mzj/mw/git/video-demo/src/videoEnglish.js:128:10)
at processTicksAndRejections (internal/process/task_queues.js:82:5)
(node:4663) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4663) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

以上如果删除添加FFAudio代码,执行是成功的,加上则报错,看能否解决。

@drawcall
Copy link
Member

To add audio, please use the addAudio method

@robinma robinma closed this as completed Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants