Example: /AVFoundation/Simply Sound Play

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/AVFoundation/Simply Sound Play


Required plugins for this example: MBS AVFoundation Plugin, MBS MacCG Plugin, MBS MacCF Plugin, MBS Main Plugin, MBS MacBase Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /AVFoundation/Simply Sound Play

This example is the version from Tue, 30th Dec 2013.

Project "Simply Sound Play.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() // pick some movie dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4a") if f.Exists = false then MsgBox "Please change code to point to a valid movie/audio file." quit end if dim e as NSErrorMBS p = new AVAudioPlayerMBS(f, e) if e<>nil then MsgBox e.LocalizedDescription quit end if p.enableRate = True if p.play then // ok else MsgBox "Failed to play!" end if End EventHandler
Property p As AVAudioPlayerMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class Window1 Inherits Window
Control BevelButton1 Inherits BevelButton
ControlInstance BevelButton1 Inherits BevelButton
EventHandler Sub Action() dim p as AVAudioPlayerMBS = app.p p.rate = 2.0 End EventHandler
End Control
End Class
End Project

The items on this page are in the following plugins: MBS AVFoundation Plugin.


💬 Ask a question or report a problem