I am creating a little audio editor using the Cocoa frameworks for Mac OS X. I implemented "copy" by writing the selected samples to a temporary WAV file, then using NSSound to load the URL and then push the data to the pasteboard (writeToPasteboard:).
Now I am working on paste. I create an NSSound from the pasteboard and am now stuck. How do I get access to the samples?
You don't. NSSound doesn't give you access to raw sample data.
You'll need to use the Audio Toolbox framework instead. It provides two APIs for reading and writing audio in files: Audio File Services is the lower-level of the two, whereas Extended Audio File Services supports compression and other features.
You may want to use the callbacks-based APIs in Audio File Services, since these could save you from having to use a temporary file. Instead, you'd set an NSMutableData object as the “client data” of the audio file, then implement “write” by copying the bytes into the relevant range of that data (setting its length first if needed) and “read” by copying some range of the data out.
Related
I searched the web for an example to read a wav or ogg audio file with TarsosDSP library for android but couldn't find any.
Please provide me with brief code example for android to load an audio file from android's resource directory R.raw.audioFile into TarsosDSP.
I tried PipedAudioStream but it requires a string input while R.raw.audioFile returns an int.
I'm sure this is right in front of my face, but I'm a bit of a nooob...
How can I define which Photos Library is loaded vs the current method which loads the System Library?
I presume it's somewhere along the lines of here from the sample code?
// Setup the media library to load only photos, don't include other source types.
let options: [String : AnyObject] =
[MLMediaLoadSourceTypesKey: MLMediaSourceType.image.rawValue as AnyObject,
MLMediaLoadIncludeSourcesKey: [MLMediaSourcePhotosIdentifier, MLMediaSourceiPhotoIdentifier] as AnyObject]
// Create our media library instance to get our photo.
mediaLibrary = MLMediaLibrary(options: options)
Is it a matter of having selected MLMediaSourceiPhotoIdentifier which defaults to the System Library? If so how do you go about opening other Libraries?
Help! Thankssss
Per the documentation of MLMediaLibrary, there is only three other options except for the standard media sources:
Non-App-Specific Media Source Identifiers:
MLMediaSourceCustomFoldersIdentifier
The media source for custom folders. Currently, the only custom folder is the folder containing audio loops from Apple.
MLMediaSourceAppDefinedFoldersIdentifier
The media source for app-defined folders. This identifies a media source created from a relative path inside the caller’s app bundle.
MLMediaSourceMoviesFolderIdentifier
The media source for the user’s Movies folder.
Based on this, I'd say it's highly likely that the functionality to create a MLMediaLibrary from an arbitrary filePath does not exist. Indeed, the API will only allow you to interface to the library that is currently being used by iPhoto, iMovie or other apps respectively.
I'm wondering how it possible to extract images from .swf viewer?
Note that .swf file have not images itself.
For example I'm trying extract images from AVON catalogue from this link - http://avon.com.ua/PRSuite/eBrochure.page?index=1&cmpgnYrNr=201404&pageNo=0
Any ideas?
Best way is to put the .swf file in a decompiler for image extraction. Decompilers are smart enough to extract images for you and arrange them.
JPEXS Free Flash Decompiler is a more popular one
http://www.free-decompiler.com/flash/
You can extract other useful content from it as well.
Just download the .swf file from the website
A while back (like around 1999) I wrote a set of tools for Flash animations.
One of the tools is swf_dump which can be used to extract objects (i.e. write the objects in a form of script that sswf can nearly recompile...)
The tool also allows for extracting images that are inline (not downloaded dynamically by the flash animation, if so, anyway, you could as well download those images manually, you'd need the URL, though.)
The command line you can use is:
swf_dump -d my-animation.swf
Then your current folder will be littered with all the images that were found in the flash file. It extracts JPEGs and PNGs. The source can be compressed (SWF or CWF are supported.)
Now, you're on your own to compile that thing... The project is here and is in great need of updating (but Flash is kind of going out too...)
https://sourceforge.net/projects/sswf/
I have tried to find out the way I can put locks or disable the copy and paste on the PDF file after the conversion. I looked at the ConversionJobSettings properties but I couldn’t be able to accomplish this.
Based on what I have read, the sharepoint2010 Word Automation services API provides very limited capability in manipulating the conversion logics but is there any way I can lock down the content so that it cannot be copied?
Thank for your help
You will either need to code something up yourself or get a third party product such as this one, which allows conversion as well as PDF manipulation including security and watermarking.
Note that I worked on this product, so I am obviously biased. Having said that, it works brilliantly.
The only way to prevent copy and paste (as text) is to create image versions of the pages and saves those as a PDF.
a possible solution:
1) Use Word automation to print to a PostScript (PS) printer driver to get a .ps file
2) Use GhostScript to convert the PS to tif files
3) Create a PDF using the tif files (possibly with GhostScript too)
I am currently writing an application working with specially prepared image data. Another tool prepares the images (basically PNGs with additional data stored in the meta-data section). Now my tool works with these files, but not with all PNGs, so "we" decided to use a different file extension. So far, so good.
Now, because I am a lazy sack I implemented some file type registration to allow double-clicking on the file and opening it in my application (no problem at all).
And here is my Question:
It would be cool if the windows explorer could still show me the thumbnail previews for my files. Since they basically are still PNG files, it should be possible without writing my own shell extension (at least I believe so).
I quickly tried to copy all registry keys and values from HKCR.png to HKCR.mInDat (my file name ext) and it worked. However, I would prefere knowning what I am doing ;-)
Which of the registry settings are responsible for the thumbnail preview control and which can I use to get the preview for my file types?
I tried to google it, but I failed, since it seems I am unable to come up with the right buzz-words to find the info I need. Please, help me.
Thank you!
Yours,
3of4
Simple:
[HKEY_CLASSES_ROOT\.apng]
#="apng"
"Content Type"="image/png"
"PerceivedType"="image"
[HKEY_CLASSES_ROOT\apng\shellex\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
#="{3F30C968-480A-4C6C-862D-EFC0897BB84B}"