# Audio file cut off after 2 seconds

**URL:** <https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911>\
**Category:** Other\
**Tags:** sound\
**Created:** [November 22, 2018, 11:28pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911 "2018-11-22T23:28:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Camacho](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@Jose\_Camacho](https://discourse.psychopy.org/u/Jose_Camacho)\
**Post date:** [November 22, 2018, 11:28pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/1 "2018-11-22T23:28:10Z")

</div>

I have an experiment that presents three images sequentially plus an audio file, all of them taken from an excel file loop.

The first image and the sound file start at the same time, but when the second file is introduced, the sound file is suddenly cut off.

I’ve tried simplifying the routine to include only the sound file, and it is still cut off after 2 seconds (no duration is set in the experiment).

This does not happen when the sound file is played directly in the experiment (not through and excel routine).

I am running Psychopy 3 on Windows 10  
Any ideas? Thanks  
Jose

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [November 23, 2018, 9:26am UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/2 "2018-11-23T09:26:30Z")

</div>

Hi @Jose_Camacho, I am not clear what you are doing in your experiment. Would you be able to upload a minimal working example with the error?

---

<div class="post-metadata">

**Author:** ![Jose\_Camacho](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@Jose\_Camacho](https://discourse.psychopy.org/u/Jose_Camacho)\
**Post date:** [November 23, 2018, 3:55pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/3 "2018-11-23T15:55:53Z")

</div>

Hi @dvbridges, thanks. I’ve uploaded the samples here: [https://drive.google.com/open?id=1pmiPWoEoA7PqLYKp9pqlZ7F5vs5UmCz2](https://drive.google.com/open?id=1pmiPWoEoA7PqLYKp9pqlZ7F5vs5UmCz2)

I’ve noticed that the length of the first audio file under the “audio” column in the excel is what determines the length of the rest of the audio file, so that “generic.wav” is 3 seconds long, and the rest will play up to 3 seconds but no longer

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [November 23, 2018, 4:36pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/4 "2018-11-23T16:36:28Z")

</div>

Great, thanks. Can you please two audio files as an example, one short and one long?

---

<div class="post-metadata">

**Author:** ![Jose\_Camacho](https://avatars.discourse-cdn.com/v4/letter/j/838e76/32.png) [@Jose\_Camacho](https://discourse.psychopy.org/u/Jose_Camacho)\
**Post date:** [November 23, 2018, 6:23pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/5 "2018-11-23T18:23:53Z")

</div>

Done (same link as above). Thanks

---

<div class="post-metadata">

**Author:** ![susanb](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@susanb](https://discourse.psychopy.org/u/susanb)\
**Post date:** [January 18, 2019, 8:07pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/6 "2019-01-18T20:07:32Z")

</div>

I am having the same issue! I have a loop going through 40 audio files all ~4-7 seconds in length. But all the files will only play for as long as the duration of the shortest file in the list (i.e. the 7 sec. files are getting cut off after 4 sec.).

How can I remedy this so that all audio files play for their full duration? I have tried setting the duration at various intervals as well as leaving it infinite.

Thanks!

---

<div class="post-metadata">

**Author:** ![chrisd](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@chrisd](https://discourse.psychopy.org/u/chrisd)\
**Post date:** [October 16, 2019, 3:14pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/7 "2019-10-16T15:14:28Z")

</div>

I’m having the same issue!

---

<div class="post-metadata">

**Author:** ![BenY](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@BenY](https://discourse.psychopy.org/u/BenY)\
**Post date:** [March 10, 2020, 1:35pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/8 "2020-03-10T13:35:52Z")

</div>

I am still having this issue… has anyone solved it?

---

<div class="post-metadata">

**Author:** ![BenY](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@BenY](https://discourse.psychopy.org/u/BenY)\
**Post date:** [March 10, 2020, 3:53pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/9 "2020-03-10T15:53:11Z")

</div>

Actually, I found a solution- go to preferences, and delete the '‘sounddevice’ library. When using the other libraries, PsychoPy updates the length of the sound file in every frame of the loop.

---

<div class="post-metadata">

**Author:** ![Laura\_Pissani](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laura_pissani/32/14656_2.png) [@Laura\_Pissani](https://discourse.psychopy.org/u/Laura_Pissani)\
**Post date:** [July 8, 2020, 8:12pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/10 "2020-07-08T20:12:39Z")

</div>

Hi @BenY, can you please specify how to delete the library, I went to preferences but did not find anything to delete. Thanks.

---

<div class="post-metadata">

**Author:** ![gleisner-robot](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gleisner-robot/32/35231_2.png) [@gleisner-robot](https://discourse.psychopy.org/u/gleisner-robot)\
**Post date:** [September 30, 2020, 6:07pm UTC](https://discourse.psychopy.org/t/audio-file-cut-off-after-2-seconds/5911/11 "2020-09-30T18:07:01Z")

</div>

Hi @Laura_Pissani, you need to go to File \> Preferences \> Hardware \> audio library and you can delete it there.
