1
00:00:01,550 --> 00:00:07,970
OK, so we can add songs, we can remove songs, now we want to look at starting to play songs, so

2
00:00:08,480 --> 00:00:09,700
let's go ahead and close this.

3
00:00:09,740 --> 00:00:13,880
So the thing we're going to use to play songs is something called pygame.

4
00:00:14,030 --> 00:00:19,850
And pygame is a sort of third party python system, let's call it.

5
00:00:20,030 --> 00:00:20,830
That helps.

6
00:00:21,050 --> 00:00:23,390
That allows you to build games with Python.

7
00:00:23,510 --> 00:00:29,990
And it comes with a fairly robust music system that we can use and we can use it very, very easily.

8
00:00:30,140 --> 00:00:32,390
And so that's what we're going to start to set up in this video.

9
00:00:32,390 --> 00:00:35,360
So we have to actually download it onto our computer in order to use it.

10
00:00:35,370 --> 00:00:36,330
So that's what we're going to do now.

11
00:00:36,350 --> 00:00:37,640
So let's head over to our terminal.

12
00:00:39,250 --> 00:00:46,720
And let me just clear the screen, so in order to install this, we type and PPIF install pygame and

13
00:00:46,720 --> 00:00:51,760
make sure you're in your seat and B three directory, make sure your virtual environment is turned on

14
00:00:51,970 --> 00:00:55,000
because we're going to install this inside of our virtual environment.

15
00:00:55,210 --> 00:01:00,100
One of the reasons why we have a virtual environment so that we can install things just like this into

16
00:01:00,100 --> 00:01:00,230
it.

17
00:01:00,520 --> 00:01:04,000
Now, this will only be available to us in our virtual environment.

18
00:01:04,000 --> 00:01:08,890
If we deactivate our virtual environment, pygame won't be there and our app won't work.

19
00:01:09,070 --> 00:01:09,260
Right.

20
00:01:09,370 --> 00:01:11,440
So make sure you're in your virtual environment.

21
00:01:11,440 --> 00:01:12,940
So Pip, install pygame.

22
00:01:14,560 --> 00:01:21,170
And there we go, it connects online, Pippi is the Python installation program.

23
00:01:21,190 --> 00:01:24,700
I think it stands for it installs little programs for you with Python.

24
00:01:24,700 --> 00:01:30,190
So, OK, we've successfully installed pygame and we're good to go.

25
00:01:30,190 --> 00:01:31,810
So in order to use this.

26
00:01:33,520 --> 00:01:38,770
Let's head up to the top of our program and we need to import it into our file here, so let's go import

27
00:01:39,460 --> 00:01:40,120
pygame.

28
00:01:40,990 --> 00:01:44,200
And that's all there is to it now in order to start using this thing.

29
00:01:44,890 --> 00:01:47,830
Let's go initialise pygame.

30
00:01:48,580 --> 00:01:50,500
So we would just go pygame.

31
00:01:51,890 --> 00:01:52,850
That Mixu.

32
00:01:53,720 --> 00:01:59,300
Dot net, and this is a function and the mixer is the thing that we're going to be using, it's a music

33
00:01:59,300 --> 00:02:00,980
mixer, basically, right.

34
00:02:01,220 --> 00:02:03,530
So we go ahead and initialize it.

35
00:02:03,530 --> 00:02:05,660
And that's really all there is to it.

36
00:02:05,930 --> 00:02:07,670
That's the only thing we have to do now.

37
00:02:07,670 --> 00:02:10,260
We can just start using it in our program.

38
00:02:10,580 --> 00:02:12,440
So I think that's all for this video.

39
00:02:12,470 --> 00:02:15,350
Go ahead and install pygame and import it if you haven't already.

40
00:02:15,500 --> 00:02:18,410
In the next video, we'll start to play our first song.
