Skip to content

Setting single Sound volume has no effect? #70

@sabiland

Description

@sabiland

iOS 18 or Simulator.

It appears, that setting volume on single Sound object has no effect? Volume is always the same?

ChatGPT helped me to solve the issue. Just before playing Sound instance, this code solves the volume issues:

do {
    try AVAudioSession.sharedInstance().setCategory(
        .playback, 
        mode: .default, 
        options: []
    )
    try AVAudioSession.sharedInstance().setActive(true)
} catch {
    Helper.sabiprError("Audio session error: \(error.localizedDescription)")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions