# nodesnim/nodes/audio_stream_player

Dark Mode

Search:
Group by:

AudioStreamPlayer used for playing audio.

AudioStream is responsible for audio. You can play multiple audio recordings at once.

# Imports

node, ../thirdparty/sdl2/mixer, ../core/enums, ../core/audio_stream

# Types

    AudioStreamPlayerObj {...}{.final.} = object of NodeObj
      paused*: bool
      volume*: cint
      stream*: AudioStreamRef

    AudioStreamPlayerRef = ref AudioStreamPlayerObj

# Procs

    proc AudioStreamPlayer(name: string = "AudioStreamPlayer"): AudioStreamPlayerRef {...}{.
        raises: [], tags: [].}

  Creates a new AudioStreamPlayer.

  Arguments:

  - `name` is a node name.

  Examples:

      var audio = AudioStreamPlayer("AudioStreamPlayer")

# Methods

    method duplicate(self: AudioStreamPlayerRef): AudioStreamPlayerRef {...}{.base,
        raises: [], tags: [].}

  Duplicates AudioStreamPlayer object and create a new AudioStreamPlayer pointer.

    method pause(self: AudioStreamPlayerRef) {...}{.base, raises: [], tags: [].}

  Pauses stream.

    method play(self: AudioStreamPlayerRef) {...}{.base, raises: [], tags: [].}

  Play stream.

    method resume(self: AudioStreamPlayerRef) {...}{.base, raises: [], tags: [].}

  Resume stream.

    method setVolume(self: AudioStreamPlayerRef; value: cint) {...}{.base, raises: [], tags: [].}

  Changes stream volume.

  Arguments:

  - `volume` is a number in range `0..128`.