# How to manipulate audio position

**URL:** <https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891>\
**Category:** Questions about Thunkable X\
**Created:** [February 2, 2021, 5:31am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891 "2021-02-02T05:31:57Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 3, 2021, 4:33am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/21 "2021-02-03T04:33:14Z")

</div>

Hmm… something off in terms of your calculations then. You can post a screenshot of your blocks or PM me with a link to your project and I’ll see if I can figure out why.

On a related note: does anyone know how to record a sound and **stop** recording using the new drag-and-drop interface? 🤨

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [February 3, 2021, 4:36am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/22 "2021-02-03T04:36:00Z")

</div>

This is my code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/e/4ea003a152f50c57623d960b397e0035d3f41a87.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 3, 2021, 4:36am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/23 "2021-02-03T04:36:41Z")

</div>

You’re using [app variable **end** seconds since 1970]. Did you mean to do that? I suggested you use [app variable **start** seconds since 1970].

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [February 3, 2021, 4:37am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/25 "2021-02-03T04:37:42Z")

</div>

Oh my bad! I duplicated a end variable block and forgot to change the name😀

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 3, 2021, 4:39am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/26 "2021-02-03T04:39:21Z")

</div>

A quick way to test this is to set a label to the value of [app variable time]. Then see if you get the expected value. For example, if you recorded for 15.59, you’d expect to get back 15.591274857134 or 15 if you’re rounding. If you’re rounding to the nearest second, add the [round] block that I have in my second screenshot.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [February 3, 2021, 4:39am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/27 "2021-02-03T04:39:38Z")

</div>

Is this supposed to happen?  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5bad1a10e080bb616e8cf573d5eb652359bf3372.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 3, 2021, 4:40am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/28 "2021-02-03T04:40:52Z")

</div>

You’ll have to decide how much to round your duration. See the comment I made just above about rounding.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [February 3, 2021, 4:43am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/29 "2021-02-03T04:43:46Z")

</div>

Thanks, testing that right now. When I tried it again, I got 1:14, which seems correct(didn’t use the phone’s timer).

---

<div class="post-metadata">

**Author:** ![carlinmclellan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/carlinmclellan/32/77831_2.png) [@carlinmclellan](https://community.thunkable.com/u/carlinmclellan)\
**Post date:** [November 29, 2021, 9:38pm UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/30 "2021-11-29T21:38:24Z")

</div>

This was a very informative discussion.

I wanted to see if anyone knows if it’s possible to move to a different part of a song, by moving the slider? i.e. to rewind, fast forward by dragging the slider left and right.

I’ve been able to rig up a super basic progress bar which moves as the song progresses, but I want the user to be able to manipulate the position of the song.

Here’s my project.  
[https://x.thunkable.com/copy/b233b14e33703e55ade7db7d723bf9ad](https://x.thunkable.com/copy/b233b14e33703e55ade7db7d723bf9ad)

I would so dealy love to be able to make this work, I’ve been trying to figure this out for many months!!

TIA

 ![Screen Shot 2021-11-30 at 8.37.57 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/8/b86253298cbfb38c6add544d63c2d019047a94e6.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 30, 2021, 3:58am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/31 "2021-11-30T03:58:24Z")

</div>

I’m still trying to figure that out. I’ve also made a progress bar that displays elapsed time but am unable to find a way to shift audio position.  
You’re project link isn’t working; would it be possible for your to share the project page?

---

<div class="post-metadata">

**Author:** ![carlinmclellan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/carlinmclellan/32/77831_2.png) [@carlinmclellan](https://community.thunkable.com/u/carlinmclellan)\
**Post date:** [November 30, 2021, 4:25am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/32 "2021-11-30T04:25:50Z")

</div>

[https://x.thunkable.com/copy/8d73b5e6b66cbe2a135d4af5af0a1c40](https://x.thunkable.com/copy/8d73b5e6b66cbe2a135d4af5af0a1c40)

Hi codeswept, see if that link works?

Hmmm yeah I don’t know if it’s possible on Thunkable?  
I had a bit of a muckaround in AppGuyver and was able to get it working there, but would prefer to use Thunkable if I can!

The other thing I tried was using a webviewer and hosting the song on my Wix website which has an audio player. But the sizing going between iPad and phone seemed impossible, and I’d prefer for this to work offline.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 30, 2021, 4:42am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/33 "2021-11-30T04:42:07Z")

</div>

Using JavaScript you can synchronize a progress bar with a song file but this means using `Web Viewer` not direct Thunkable components.

---

<div class="post-metadata">

**Author:** ![carlinmclellan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/carlinmclellan/32/77831_2.png) [@carlinmclellan](https://community.thunkable.com/u/carlinmclellan)\
**Post date:** [November 30, 2021, 5:00am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/34 "2021-11-30T05:00:17Z")

</div>

Thanks muneer.

I pretty much know nothing about JavaScript. Do you think it’s worth learning?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [November 30, 2021, 5:31am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/35 "2021-11-30T05:31:47Z")

</div>

> [@carlinmclellan](#):
>
> Do you think it’s worth learning?

Absolutely!!! Js + Thunkable is an awesome combo

---

<div class="post-metadata">

**Author:** ![carlinmclellan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/carlinmclellan/32/77831_2.png) [@carlinmclellan](https://community.thunkable.com/u/carlinmclellan)\
**Post date:** [November 30, 2021, 5:51am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/36 "2021-11-30T05:51:00Z")

</div>

Awesome 🙂

Any recommendations of how to get started?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 30, 2021, 6:48am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/37 "2021-11-30T06:48:13Z")

</div>

Both Thunkable and AppGyver are built on React Native which is built on JavaScript.

---

<div class="post-metadata">

**Author:** ![carlinmclellan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/carlinmclellan/32/77831_2.png) [@carlinmclellan](https://community.thunkable.com/u/carlinmclellan)\
**Post date:** [January 2, 2022, 10:30pm UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/38 "2022-01-02T22:30:58Z")

</div>

Hi codeswept,

I was wondering if you had any luck finding a way to shift audio position with a progress bar (slider)?

Cheers

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [January 3, 2022, 3:26am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/39 "2022-01-03T03:26:07Z")

</div>

I’ve pretty much given up hope by now 😔 I’ve tried, like @muneer suggested counting the recording time but that still doesn’t allow me to change position in audio.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 3, 2022, 5:12am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/40 "2022-01-03T05:12:19Z")

</div>

@carlinmclellan @codeswept

I had an idea. You can upload a song to YouTube Music and then use time parameters in the url to determine the starting point. For example, I added **&t=46s** to the end of this url to make it start at the 0:46 mark:

[https://music.youtube.com/watch?v=cIOsuEy-QuY&list=MLPT&t=46s](https://music.youtube.com/watch?v=cIOsuEy-QuY&list=MLPT&t=46s)

**But currently that song is private in my account.** I’m not sure how to set it to public. But if it was possible – and it’s definitely possible with YouTube _videos_ – you could theoretically move a slider in Thunkable and have the app reload the sound at the desired position using url parameters.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 3, 2022, 5:38am UTC](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891/41 "2022-01-03T05:38:38Z")

</div>

Okay, I didn’t have much luck with that. For some reason, uploaded songs are not available to the public.

But I do have an example that offers one way of having a slider for playback. It’s just not customizable. If you add a Web Viewer and set the url to a YouTube Music song that is commercially available (e.g. this Chris Pureka song url which I’ve set to start at 0:46 → [YouTube Music](https://music.youtube.com/watch?v=2Nrgufi9Ak8&list=RDAMVM2Nrgufi9Ak8&t=46s)), when you press play ( **requires Thunkable Live** ), it opens a full-screen viewer at least on an iPhone and it includes a slider:

 ![IMG_E547A6D23140-1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/f/9fed419d132239afabae560b46aee1327e7a5812.jpeg)

I know this doesn’t solve the problem but it might be a step closer…?

As another example, I figured out how to move a slider to load a song url at various points on its timeline:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/a/ba3eb303213177524fcb60590773a22a25ca1d9c.png)

Try it yourself at [Thunkable](https://x.thunkable.com/copy/7e47a240f670fcf3666e50ff1a73ba86)  
(See the screen with @codeswept’s username)

The only problem now is that you have to press play each time the song reloads. Also, I had to hard code the length of the song (242 seconds).

Soundcloud urls work similarly (except that the timestamp is formatted as **#t=46s** ) but the web viewer isn’t as user-friendly as with YouTube Music and it doesn’t seem to respect the timestamp value.

[Previous page](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891.md?page=1)

[Next page](https://community.thunkable.com/t/how-to-manipulate-audio-position/1078891.md?page=3)
