Audio cropping in objective c

Multi tool use
I am developing an iOS application which has a requirement to trim an mp3 audio file selected from iPhone library. i have done the cropping functionality in a demo code but I am stuck in the UI design. I don't know how to get the selected song duration in seconds. I made a custom slider using UIView as left and right slider point same as UISlider and i can move them over the loaded audio file, but i don't understated how to get the selected duration.
ios objective-c iphone cocoa-touch
|
show 1 more comment
I am developing an iOS application which has a requirement to trim an mp3 audio file selected from iPhone library. i have done the cropping functionality in a demo code but I am stuck in the UI design. I don't know how to get the selected song duration in seconds. I made a custom slider using UIView as left and right slider point same as UISlider and i can move them over the loaded audio file, but i don't understated how to get the selected duration.
ios objective-c iphone cocoa-touch
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55
|
show 1 more comment
I am developing an iOS application which has a requirement to trim an mp3 audio file selected from iPhone library. i have done the cropping functionality in a demo code but I am stuck in the UI design. I don't know how to get the selected song duration in seconds. I made a custom slider using UIView as left and right slider point same as UISlider and i can move them over the loaded audio file, but i don't understated how to get the selected duration.
ios objective-c iphone cocoa-touch
I am developing an iOS application which has a requirement to trim an mp3 audio file selected from iPhone library. i have done the cropping functionality in a demo code but I am stuck in the UI design. I don't know how to get the selected song duration in seconds. I made a custom slider using UIView as left and right slider point same as UISlider and i can move them over the loaded audio file, but i don't understated how to get the selected duration.
ios objective-c iphone cocoa-touch
ios objective-c iphone cocoa-touch
edited Dec 27 at 15:09


James Z
11.1k71735
11.1k71735
asked Dec 27 at 13:38


Chetan sharma
14917
14917
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55
|
show 1 more comment
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55
|
show 1 more comment
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53946010%2faudio-cropping-in-objective-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53946010%2faudio-cropping-in-objective-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
lzZBmQ,JeLCvIqa3Ned48IdkjCY6rtrqNm,efy6BSolH
Can you please share what you have tried?
– Harjot Singh
Dec 27 at 13:43
How is your audio data stored? If it is from iPhone library as a MPMediaItem then it has a PlaybackDuration property.
– meggar
Dec 27 at 13:45
Yes for get mp3 file list i am using MPMediaItem, and yes it has PlaybackDuration but i am stuck to get the duration after i select some area of amp3 file by cropping view how to get that selected duration value that i am not understanding.
– Chetan sharma
Dec 27 at 14:38
@Harjot Singh Til now i just make the demo for trim any audio with heard code start and end point. And i am stuck due to the UI requirement. In other cropping apps mp3 audio load on slider and user can select the crop duration by moving slider start and and point but in my case client want that selection area should not move it will fix for 20 or less then 20 second and the loaded mp3 audio file on UI element will move behind it, so i am not exact way to get the selected duration value between start and end point.
– Chetan sharma
Dec 27 at 14:43
UISlider has minimum and maximum value as property to access them, did u try that?
– Harjot Singh
Dec 27 at 14:55