Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSSoundMBS class.
NSSoundMBS.channelMapping as Integer()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
A channel map correlates a sound’s channels to the the output-device’s channels. For example, a two-channel sound being played on a five-channel device should have a channel map to optimize the sound-playing experience. The default map, correlates the first sound channel to the first output channel, the second sound channel to the second output channel, and so on.
Available in OS X v10.5 and later. Deprecated in OS X v10.9.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSound expects the data to have a proper magic number, sound header, and data for the formats it supports.
See also:
NSSoundMBS.Constructor(data as MemoryBlock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
data: Audio data with which the receiver is to be initialized. The data must have a proper magic number, sound header, and data for the formats the NSSound class supports.
See also:
NSSoundMBS.Constructor(file as folderitem, ByReference as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
file: Path to the sound file.
ByReference: When true only the name of the sound is stored with the NSSound instance when archived using encodeWithCoder:; otherwise the audio data is archived along with the instance. (not used in Xojo)
See also:
NSSoundMBS.Constructor(url as string, ByReference as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
url: URL to the sound file with which the receiver is to be initialized.
ByReference: When true only the name of the sound is stored with the NSSound instance when archived using encodeWithCoder:; otherwise the audio data is archived along with the instance. (not used in Xojo)
See also:
NSSoundMBS.currentTime as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Receiver's playback progress in seconds.
Sounds start with currentTime == 0 and end with currentTime == ([<sound> duration] - 1).
Available in Mac OS X v10.5 and later.
This property is not archived, copied, or stored on the pasteboard.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Available in Mac OS X v10.5 and later.
NSSoundMBS.isPlaying as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when the receiver is playing its audio data, false otherwise.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when the receiver restarts playback when it finishes, false otherwise.
Default: false
Available in Mac OS X v10.5 and later.
When loops is true, the delegate does not call the SoundFinished event on the end of its content and restarts playback.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Name assigned to the receiver; "" when no name has been assigned.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when playback is paused successfully, false when playback is already paused or when an error occurred.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when playback is initiated, false when playback is already in progress or when an error occurred.
This method initiates playback asynchronously and returns control to your application. Therefore, your application can continue doing work while the audio is playing.
NSSoundMBS.playbackDeviceIdentifier as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an unique identifier of a sound output device.
Available in Mac OS X v10.5 and later.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when playback is resumed, false when playback is in progress or when an error occurred.
Assumes the receiver has been previously paused by sending it pause.
NSSoundMBS.setChannelMapping(mapping() as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Mapping: Audio-channel—to—device–channel mappings for the receiver.
Available in OS X v10.5 and later. Deprecated in OS X v10.9.
NSSoundMBS.setDelegate(DelegateHandler as NSSoundDelegateMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
You can assign one delegate to several sounds.
But the delegate object is not referenced, so keep it alive with your own reference, so RB won't destroy it too early.
NSSoundMBS.setName(name as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns True when successful; false otherwise.
If the receiver is already registered under another name, this method first unregisters the prior name.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
True when playback is concluded successfully or if it's paused, false otherwise.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
This method does not affect the systemwide volume.
Available in Mac OS X v10.5 and later.
0.0 is not sound and 1.0 is full sound.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The items on this page are in the following plugins: MBS MacBase Plugin.