Download Taylor Swift’s Album “Reputation” to MP3 Since first released on August 24, 'Look What You Made Me Do” broke a string of records, including the record for the most plays in a single day on Spotify, and became the most-watched music video within 24 hours. Simple and fast mp3 music downloader, powered by Outly Limited and Jamendo ( ). Application allows to stream and download any song.
I am getting mp3 url as a response of api calling.I want to play that audio, so how can i do that? (ios swift)
here is my response
here is my code::
where am i going wrong?
GovindGovind
7 Answers
I tried the following,
Add the below methods,
And your play method as it is,
Download the mp3 file and then try to play it, somehow AVAudioPlayer does not download your mp3 file for you. I am able to download the audio file and player plays it.
Remember to add this in your info.plist since you are loading from a http source and you need the below to be set for iOS 9+
satheeshwaransatheeshwaran
Use AVPlayer instead of AVAudioPlayer to play remote content. As per documentation AVAudioPlayer needs mp3 file to play Audio. AVAudioPlayer not provide support for streaming.
Try this code , its working fine for me
Please keep in mind to set App Transport Security(ATS) in info.plist file.
technerdtechnerd
Since
AVPlayer
is very limited (for example you cannot change url
there without regenerate whole AVPlayer
I think you should use AVQueuePlayer
:From the docs:
AVQueuePlayer is a subclass of AVPlayer used to play a number of items in sequence. Using this class you can create and manage a queue of player items comprised of local or progressively downloaded file-based media, such as QuickTime movies or MP3 audio files, as well as media served using HTTP Live Streaming.
So in Swift 3 it will work like this:
...
JakubJakub
SWIFT 4
1 -
import AVFoundation
2 - declare player
3 - in ViewDidLoad call function and pass the streaming url like String
4 - function to play
For me is the best and simply way to streaming audio in swift.
oscar castellonoscar castellon
After some research, and some disappointment since none of the answers solved my problem, I've come to a solution and here's the final result. The accepted answer is half right, you still need to create an
AVPlayerLayer
Danilo LemesDanilo Lemes
Sazzad Hissain KhanSazzad Hissain Khan
To play a sound in swift2 is
Let me know if it working.
Zumry MohamedZumry Mohamed
Not the answer you're looking for? Browse other questions tagged iosswiftswift2ios9avaudioplayer or ask your own question.
Biography
Taylor Swift is a writer and performer of country pop songs, who began her career as a teenager. In 2006 at the age of 16 she released her first album, which made her one of the most popular, sparking and youngest country-pop's vocalists in the United States. Taylor Swift was born in Wyomissing, Pennsylvania. Now she lives in Hendersonville, Tennessee with her parents and her brother, Austin. Although Swift is a raw talent for the American public, she had been performing since early childhood. It is considered that she tooк inspiration and encouragement from her opera-singing grandmother, though Taylor was always obsessed with country music. At the age of ten, Swift became a local star in her home town Wyomissing, singing at fairs, festivals and karaoke contests. She picked up a guitar at 12 and started writing her own songs. Then Taylor realized how readily she could channel all her impetuous emotions into the music. As Taylor’s family was not strangers to music business, they soon discovered both her talent and dedication. After recording several demo tapes of her singing along to karaoke songs at a studio, they began taking regular trips to Nashville where they handed them out at every label in order to obtain a record deal. There she began performing casually, meet and write with local songwriters in the area. At the beginning Swift sidestepped the major labels in town trying to take a chance with smaller ones, but faced much rejection. She sang The Star-Spangled Banner before a Philadelphia 76s game at the age of 11and her performance fell into the hearts of the crowd. Ultimately, her family made the decision to move to nearby Nashville suburb.
While performing at Nashville’s The Bluebird Café, Swift caught the eye of music industry veteran Scott Borchetta, who signed her to his newly formed independent record label Big Machine Records and released her debut single, Tim McGraw, in August 2006. This song was named after Tim McGraw a country superstar and one of Taylor's greatest influences, who was also surprised to find himself the subject of her debut single.This song entered her debut album Taylor Swift, which was released on October 24, 2006. It turned out to be a doubtless success and brought her fame. Swift wrote or co-wrote all of the songs on the album Original compositions from her debut set are filled with all the ebullience and drama of adolescent life. All four catchy singles from her self-titled album following Tim McGraw: Teardrops on My Guitar, Our Song, Picture to Burn and Should've Said No entered Top 40 hits on the Billboard Hot 100. Her self-titled debut was certificated multi-platinum. In October 2007 Swift received Songwriter/Artist of the Year Award from the Nashville Songwriters Association International and became the youngest artist ever to win the award.
Swift also recorded a holiday album Sounds of the Season: The Taylor Swift Holiday Collection that was issued in October 16, 2007. The album proved to be less successful in comparison with her debut Taylor Swift and featured both holiday classics such as Last Christmas and original songs by Swift. In 2008 EP Beautiful Eyes saw light. Swift also received a Grammy Award for a 2008 in the category of Best New Artist. Swift's next studio album, Fearless, was released in the United States on November 11, 2008. The album peaked first on the Billboard 200 Album Chart. It was sold 592,000 copies that was the highest selling week for any country album in a year. It proved to be the largest sum for a country album since Eagles' Long Road Out of Eden. The album’s lead-off single Love Story occupied the top of Hot 100 hit. Like many country-pop albums of the 2000s, here the pop heavily outweighs the country yet Fearless never feels garish. Taylor Swift does not make any pretence that she's a teen on her sophomore album Fearless. Her music that became more mature may not quite jibe with her age but it does help make Fearless one of the best mainstream pop albums of 2008. Two years later Swift pleased her listeners with the new studio attempt Speak Now (2010), which managed to repeat its predecessor Fearless’ success by peaking at the very top of the US chart. The record was very well received by the music lovers and experts, who noted both the highest level of performance and the singer’s unquestionable growth. Taylor’s music and lyrics make listeners feel various emotions, and that is definitely the best proof of her creativity’s sincerity.
22 Taylor Swift Download Mp3
Studio Albums
Red
Taylor Swift is leaving country for the sake of a more varied music, and her lyrics are becoming more convincing and deeper. Red is an album that tracks down the progress of this great artist
Speak Now
The main theme of Taylor Swift's third studio work Speak Now is naturally love once again. The singer who is only twenty years old is pretty able to analyze her deeds, her fears and weak points
Fearless
Young US star of pop-country Taylor Swift recorded her sophomore attempt, Fearless. This surprisingly wise and mature work, filled with the romantic love stories, is sure to charm everyone
9
Singles
6
Lives
1