audio stops playing after certain amount of time when triggerAttack is called - tonejs

For our project, we're creating our own sampler from local audio sprites (audio length is 3 seconds for every file). Whenever we want to play a chord using triggerAttack, the sampler plays the chord for a maximum duration of 3 seconds and stops playing (I believe it's due to audio sprite's limit). Is there any way to extend the duration without altering sound files? Any help will be greatly appreciated.

Related

Android2.3 camera HAL capture picture issue

I'm working an Android 2.3 project and have some questions with Camera HAL implementation.
It takes me a lot of time to capture pictures, about 4s, how do I reduce it? The camera sensor is ov3640 on this project. I try to wait for 2 Vsync and capture the 3rd frame follow the Ov3640 spec for capture picture instead of sleep 1s directly when it complete the autofocus.
My second question is, how do I calculate the Vsync time?

how to correctly create a thumbnail picker with a UISlider for selection from a video?

Hi its a simple question to a hard problem (for me so far anyway)
i dont consider myself to be a beginner programmer but for the love of god I cannot seem to be able to figure this one out.... I currently have a problem related to updating a uiimageview.. its not being updated when my slider moves left and right.. it does slow the application down a little bit when i drag it which tells me there are processes happening and tells me they are connected correctly the itnerface with their methods.. whats happening or what im doing at the moment is trying to retrieve image data for a specific frame specified by time to then be able to select it as a thumbnail depending on the position of the uislider. so its a manual thumbnail picker.
I have tried many things both by connecting it through interface builder and by doing it programatically.
this is what i have one so far:
.h file
.m file
the slider method for sliderValueChanged which gets called
and finally my class method that i use to help retrieve a thumbnail image returning nsdata... passing in a video and a specified time position.
I have read here on stackoverflow that updating a uiimageview can cause memory leaks if updated regularly since it caches images.. and to use [UIImage imageWithData:] instead to avoid any leaks etc. so i have implemented this in my code yet my thumbnail view still fails to load the images based on the slider's position. (the slider is created to have the min and max values set from 0 - to the duration of the video so that the slider can only ever have a value that can correctly pick a time frame in the video in question)
If anyone could guide me in how i could fix this problem.. it is beyond me for hours now! i appreciate the help. thank you
I realised what was happening here... the slider values i had passed into my method werent appropriate for what i required.
in the class method it says CMTimeMake(value 1, value 2).. and after doing some research i understood how it worked.
basically there is a time interval you specify in value 2 in my case it was 60.. based on some code i copied.. whatever you substitute value 1 for becomes a part of the time interval.. They are a numerator and denominator, so 1 /60 equals 1 60th of a second
2/60 is equal to the time position of 2 60th of a second... if i wanted 3 seconds i would need to do 60*3 = 180 so
180/60 equals 180 60th of a second which equates to 3 seconds in total... so because my slider values were mapped to the duration of the video which the maximum was 15 seconds... the higest time frame i could get using the code i wrote in my question... i could only get the
15 60th of a second. which time frame wise not really a difference between the 1st 60th of a second hence the reason why i could not see the uimageview being updated...
so to correct this i multiplied my slider values by 60 so that each value that gets changed because they were mapped to seconds.. i multiplied by 60 .. and of course the image updated like a charm. however now i need to figure out how to speed up this process since at the moment it seems synchronous as it lags the interface greatly

Is it possible play multiple clips using presentMoviePlayerViewControllerAnimated?

I have a situation where I'd like to play 2 video clips back to back using an MPMoviePlayerViewController displayed using presentMoviePlayerViewControllerAnimated.
The problem is that the modal view automatically closes itself as soon as the first movie is complete.
Has anyone found a way to do this?
Three options:
You may use MPMoviePlayerController and start the playback of the 2nd (Nth) item after the previous is complete. This however will introduce a small gap between the videos cause by identification and pre buffering of the content.
You may use AVQueuePlayer; AVQueuePlayer is a subclass of AVPlayer you use to play a number of items in sequence. See its reference for more.
You may use AVComposition for at runtime composing one video out of the two (or N) you need to play back. Note, this works only on locally stored videos and not on remote (streaming or progressive download). Then use AVPlayer for the playback.
It's not possible. If the video assets are in local file system, consider AVComposition.

Objective C : Video Compositions

I need a bit of advice. I currently have 4 videos, 20 seconds in length each, and one MP3, 5 minutes in length.
I am merging these lot into one video, cycling every 3 seconds to the next video, for the duration of the MP3 track.
Problem 1: The videos are 20 seconds each, the MP3 is 5 minutes. It means that I will run out of video. I resolved this by running each the videos in a loop using AVMutableComposition, then exporting each of them to their new respective files.
Next, I have a fifth video in which the 4 videos plays simultaneously, each in their own quadrant of the video. This video is also compose in an AVMutableComposition which is then exported the a separate video file.
Lastly, I take these 5 videos and MP3 track, and create a composition, using AVMutableComposition again, cycling through the different videos every 3 seconds. Then I export them to the final video.
Now, the issue I'm sitting with is that exporting all those videos takes up a lot of time. Is there a way for me to use the created AVMutableComposition objects to create the final video, instead of exporting the videos and then adding them to the final composition?
Regards,
EZFrag

adjust the speed of the playback of a video

is there a way to adjust the speed of the playback of a video while playing in Objective C for the iPhone/iPod touch?
You should look at float currentPlayBackRate. This should gives you the ability to change the speed. When you assign currentPlayBackRate 0.0 it indicates movie playback stopped. When it equal one it means normal speed.
"Apple: MPMediaPlayback Protocol"