English 中文(简体)
• 如何在“Ringer”和“警觉”层面发挥声音
原标题:How to play sound on "Ringer & Alert Volume" level

在我的发言中,我想就“Ringer & 警惕量”水平发出警报/通知。

换言之,关于电话线或警报器的使用量(参考/Sound/Ringer和警报)。 这不同于与数量纽扣吨变化的系统数量。

它也应当发挥30多个秘密作用。

我知道这样做是可能的,因为有些钟子可以这样做。

UPDATE: OK I found an unideal solution. If use AudioServicesCreateSystemSoundID and load my own sound file (aif, wav, etc no mp3 or other compressed audio) than it works. The only problem is that it has to be 30 sec or shorter, but I can can cut it into 30sec pieces and play them piece by piece.

在我不知疲.的开关时,这并不奏效。

法典:

    SystemSoundID mySound;
    AudioServicesCreateSystemSoundID(CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("mySound"), CFSTR("aif"), NULL), &mySound);
    AudioServicesPlaySystemSound(mySound);

我怀疑“开放”应当这样做。 是否有任何人有一个简单的事例,把一夫/瓦夫的档案装上皮顶。 我发现了一些复杂的例子,但我所需要的只是玩弄和阻止声音(即使它揭露了这种罚款)。

最佳回答

I found it out myself. I have to use AudioServicesCreateSystemSoundID and load my own sound file (aif, wav, etc no mp3 or other compressed audio) The only problem is that it has to be 30 sec or shorter, but I can can cut it into 30sec pieces and play them piece by piece.

它在 silent默开关时没有工作

法典:

    SystemSoundID mySound;
    AudioServicesCreateSystemSoundID(CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("mySound"), CFSTR("aif"), NULL), &mySound);
    AudioServicesPlaySystemSound(mySound);
问题回答

你们应当看AVAudioPlayer课程。 这将使你能够处理任何期限的健全档案,并能够控制你希望使用的特定档案的数量。 我不是在我的马奇面前,我将提供法典。 让我知道,你是否需要进一步指示。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签