Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicka/com.composrapp.audiocropper
Titanium iOS module to crop audio
https://github.com/nicka/com.composrapp.audiocropper
Last synced: 5 days ago
JSON representation
Titanium iOS module to crop audio
- Host: GitHub
- URL: https://github.com/nicka/com.composrapp.audiocropper
- Owner: nicka
- License: other
- Created: 2014-11-24T21:20:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T16:48:13.000Z (almost 10 years ago)
- Last Synced: 2024-04-13T16:18:14.401Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 35.8 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS Crop audio
Build in support for .mp3, .m4a and .wav files.
**Usage:**
Add module:
```
var AudioCropper = require('com.composrapp.audiocropper');
```Specify in and output files:
```
var inputAudio = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'example.mp3');
var outputAudio = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'cropped-example.mp3');
```Pass arguments to module:
```
AudioCropper.cropAudio({
cropStartMarker: 4.5,
cropEndMarker: 6.5,
audioFileInput: inputAudio.resolve(),
audioFileOutput: outputAudio.resolve()
});
```Listen for events:
```
AudioCropper.addEventListener('error', function() {
Ti.API.error('Failed to crop audio');
});AudioCropper.addEventListener('success', function() {
Ti.API.info('Successfully cropped audio');
});
```### Development
1. Install packages with `npm install`
2. Update examples in `example/app.js`
3. Use `gulp ios` to build and test the module### TODO
Cleanup eventListeners.