Giter Club home page Giter Club logo

Comments (3)

minggo avatar minggo commented on June 22, 2024

虽然我对这个模块不是很了解,但是从上面的分析来看,还是很合理的建议。

from cocos-engine.

finscn avatar finscn commented on June 22, 2024

另外 AudioClip 上有 setVolume setLoop 方法.
AudioSource 上也有, 还能设置的不一样.

A

clip.setVolum(0.8)
source.volum = 0.3
source.clip = clip
source.play()

B

source.volum = 0.3
clip.setVolum(0.8)
source.clip = clip
source.play()

C

source.clip = clip
clip.setVolum(0.8)
source.volum = 0.3
source.play()

D

source.clip = clip
source.volum = 0.3
clip.setVolum(0.8)
source.play()

ABCD 播放的实际音量是多少?

并不是 后设置的优先, 也不是 clip优先 或者 source优先....
实际情况取决于 source.clip = clip 的时机, 有点乱...

from cocos-engine.

PPpro avatar PPpro commented on June 22, 2024

AudioClip 本来就是不应该包含 player 的,这个 player 是为了兼容历史版本留下的包袱

from cocos-engine.

Related Issues (20)

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.