User Tools

Site Tools


sound

Sound

The Qt documentation in C++ of this class can be read here: http://doc.trolltech.com/4.4/phonon.html

It contains useful functions for multimedia applications.

Implemented since KBasic V1.7.

Important All following functions are used by Movie, too.

KBasic does not implement the multimedia functionality itself, but relies on a backend to manage this. The backends do not manage the hardware directly, but use intermediate technologies: QuickTime on Mac, GStreamer on Linux, and DirectShow (which requires DirectX) on Windows.

The user may add support for new MIME types and effects to these systems, and the systems abilities may also be different. The support for multimedia MIME types, and audio effects in KBasic will therefore vary from system to system.

METHODS

State

Function State() As String

Possible values are

  • LoadingState
  • StoppedState
  • PlayingState
  • BufferingState
  • PausedState
  • ErrorState

ErrorType

Function ErrorType() As String

Possible values are

  • NoError
  • NormalError
  • FatalError

ErrorString

Function ErrorString() As String

Returns a human-readable description of the last error that occurred.


CurrentTime

Function CurrentTime() As Long


TotalTime

Function TotalTime() As Long


IsPlaying

Function IsPlaying() As Boolean


IsPaused

Function IsPaused () As Boolean


IsMuted

Function IsMuted () As Boolean


IsSeekable

Function IsSeekable() As Boolean


Play

Sub Play()


Play

Sub Play(String)


Load

Sub Load(String)


(PlayInQueue)

Sub PlayInQueue(String)

Sorry. Not implemented yet.


Pause

Sub Pause()


Stop

Sub Stop()


(ClearQueue)

Sub ClearQueue()

Sorry. Not implemented yet.


Seek

Sub Seek(Long)


PROPERTIES

Value

Property Value As String (ReadWrite)

Contains the path of the sound to be played. It can be an absolute path to an sound file (wav, mp3,…) like c:\myfolder\mysound.mp3 or can be an relative path to the current project like mysound.mp3 (which is present in the current project directory). Relative paths are recommended.

Might be a String containing binary data. See the binary project example for using.


(TransitionTime)

Property TransitionTime As Long (ReadWrite)

Sorry. Not implemented yet.


Muted

Property Muted As Boolean (ReadWrite)


(Volume)

Property Volume As Integer (ReadWrite)

Sorry. Not implemented yet.


(PrefinishMark)

Property PrefinishMark As Long (ReadWrite)

Sorry. Not implemented yet.


(Tick)

Property Tick As Integer (ReadWrite)

Sorry. Not implemented yet.


Enabled

Property Enabled As Boolean (ReadWrite)

If enabled, playing starts immediately after the form containing this control opens.


EVENTS

OnEvent

Sub OnEvent()

This event is raised, whenever the playing is finished.


OnStateChanged

Sub OnStateChanged(NewState As String, OldState As String)


OnAboutToFinish

Sub OnAboutToFinish()


OnFinished

Sub OnFinished ()


(OnTick)

Sub OnTick(Long)

Sorry. Not implemented yet.


(OnMutedChanged)

Sub OnMutedChanged(Boolean)

Sorry. Not implemented yet.


(OnVolumeChanged)

Sub OnVolumeChanged(Integer)

Sorry. Not implemented yet.


(OnPlayedTitleChanged)

Sub OnPlayedTitleChanged(String)

Sorry. Not implemented yet.


(OnBufferStatus)

Sub OnBufferStatus(Integer)

Sorry. Not implemented yet.


(OnTotalTimeChanged)

Sub OnTotalTimeChanged(Long)

Sorry. Not implemented yet.


sound.txt · Last modified: 2013/04/09 22:58 (external edit)