# audio.loadStream from a file outside app's sandbox?

**URL:** <https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085>\
**Category:** macOS Desktop\
**Created:** [February 7, 2017, 2:25pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085 "2017-02-07T14:25:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanko\_popov](https://forums.solar2d.com/user_avatar/forums.solar2d.com/yanko_popov/32/148_2.png) [@yanko\_popov](https://forums.solar2d.com/u/yanko_popov)\
**Post date:** [February 7, 2017, 2:25pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085/1 "2017-02-07T14:25:09Z")

</div>

Is it possible to load an audio file that is not in the application sandbox, but elsewhere (for example on the desktop etc.)? I am guessing one possible solution would be to copy that file to the sandbox, and then load it with audio.loadStream for example, but is there a way to load it directly from location different from the default ones, specified in the directory constants?

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [February 7, 2017, 4:27pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085/2 "2017-02-07T16:27:24Z")

</div>

No. display.\*, audio.\* expect files to be in one of the sandbox folders. If you want play an audio track you would need to copy the file to a writable sandbox folder (system.temporaryDirectory) and play it from there.

Rob

---

<div class="post-metadata">

**Author:** ![yanko\_popov](https://forums.solar2d.com/user_avatar/forums.solar2d.com/yanko_popov/32/148_2.png) [@yanko\_popov](https://forums.solar2d.com/u/yanko_popov)\
**Post date:** [February 7, 2017, 5:53pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085/3 "2017-02-07T17:53:17Z")

</div>

Got it! Thanks!

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [February 7, 2017, 4:27pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085/4 "2017-02-07T16:27:24Z")

</div>

No. display.\*, audio.\* expect files to be in one of the sandbox folders. If you want play an audio track you would need to copy the file to a writable sandbox folder (system.temporaryDirectory) and play it from there.

Rob

---

<div class="post-metadata">

**Author:** ![yanko\_popov](https://forums.solar2d.com/user_avatar/forums.solar2d.com/yanko_popov/32/148_2.png) [@yanko\_popov](https://forums.solar2d.com/u/yanko_popov)\
**Post date:** [February 7, 2017, 5:53pm UTC](https://forums.solar2d.com/t/audio-loadstream-from-a-file-outside-apps-sandbox/343085/5 "2017-02-07T17:53:17Z")

</div>

Got it! Thanks!
