Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSSoundMBS class.
NSSoundMBS.availableSounds as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
You can use the names in this array for the soundNamed function.
NSSoundMBS.canInitWithPasteboard as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
true when the receiver can handle the data represented by pasteboard; false otherwise.
The soundUnfilteredPasteboardTypes method is used to find out whether the class can handle the data in pasteboard.
NSSoundMBS.NSSoundPboardType as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSoundMBS.soundNamed(name as string) as NSSoundMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSound instance initialized with the sound data identified by soundName.
The returned object can be one of the following:
One that's been assigned a name with setName.
One of the named system sounds provided by the Application Kit framework If there's no known NSSound object with soundName, this method tries to create one by searching for sound files in the application's main bundle (see NSBundle for a description of how the bundle's contents are searched). If no sound file can be located in the application main bundle, the following directories are searched in order: ~/Library/Sounds, /Library/Sounds, /Network/Library/Sounds or /System/Library/Sounds.
If no data can be found for soundName, no object is created, and nil is returned.
The preferred way to locate a sound is to pass a name without the file extension. See the class description for a list of the supported sound file extensions.
NSSoundMBS.soundUnfilteredFileTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns array of strings representing the file types the NSSound class understands.
The returned array may be passed directly to the runModalForTypes method of the NSOpenPanel class.
Available in OS X v10.0 and later. Deprecated in OS X v10.5.
NSSoundMBS.soundUnfilteredPasteboardTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Array of pasteboard types that the NSSound class can accept.
Available in OS X v10.0 and later. Deprecated in OS X v10.5.
NSSoundMBS.soundUnfilteredTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 14.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns array of UTIs identifying the file types the NSSound class understands.
Available in OS X v10.5 and later.
NSSoundMBS.soundWithContentsOfFile(file as folderitem, ByReference as boolean) as NSSoundMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared 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)
NSSoundMBS.soundWithContentsOfURL(url as string, ByReference as boolean) as NSSoundMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared 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)
NSSoundMBS.soundWithData(data as MemoryBlock) as NSSoundMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared 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.
NSSoundMBS.soundWithPasteboard as NSSoundMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared 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.
The items on this page are in the following plugins: MBS MacBase Plugin.